Claude Code MCP Tutorial: Connect AI to Your Entire Dev Workflow
Learn how to set up MCP servers with Claude Code, configure essential developer tools, and build workflows that make you dramatically more productive.
Claude Code is already one of the most powerful AI coding assistants available. But when you connect it to MCP servers, it becomes something else entirely. It goes from a smart assistant that reads your code to a full development partner that interacts with your tools, databases, APIs, and documentation systems.
In this tutorial, I’ll show you exactly how to set up MCP servers with Claude Code, configure them properly, and build a workflow that makes you dramatically more productive.
Let’s get started.
What You’ll Learn
By the end of this tutorial, you’ll know how to:
- Install and configure MCP servers in Claude Code
- Set up the most essential MCP tools for development
- Use KodaDocs MCP to generate documentation from your codebase
- Manage multiple MCP servers efficiently
- Troubleshoot common MCP issues
Prerequisites
You’ll need Claude Code installed and working. If you haven’t set it up yet, install it from the official Anthropic docs. You should also have Node.js 18+ and a project you want to work with.
Understanding MCP in Claude Code
MCP (Model Context Protocol) lets Claude Code connect to external tools through a standardized interface. Each MCP server provides specific capabilities. A GitHub server gives Claude Code access to your repos. A database server lets it query your data. A documentation server lets it generate docs.
Claude Code supports three transport types for MCP servers:
- stdio for local servers running on your machine (most common)
- HTTP for remote servers (recommended for cloud and team setups)
- SSE for legacy remote connections
Most developer MCP servers use stdio, which means they run as local processes that Claude Code communicates with directly.
Step 1: Adding Your First MCP Server
The simplest way to add an MCP server is through the CLI wizard.
claude mcp add context7
Claude Code will walk you through the configuration. For Context7 (which fetches current library docs), the setup is straightforward since it doesn’t require API keys.
For servers that need configuration, you’ll provide details during the wizard:
claude mcp add github-server
It’ll ask for your GitHub token and any other required parameters.
Manual Configuration
For power users, you can edit the config file directly. Claude Code stores MCP configuration in .claude.json at your project root or ~/.claude.json for global servers.
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@context7/mcp-server"]
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
}
},
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/directory"]
}
}
}
Each server entry specifies the command to run, arguments, and any environment variables needed.
Step 2: Setting Up KodaDocs MCP
KodaDocs is an MCP server that generates end user documentation from your codebase. Here’s how to set it up with Claude Code.
Install the KodaDocs MCP Server and CLI
The KodaDocs setup has two parts: the MCP server and the CLI. Both are important. The MCP server provides the tools. The CLI gives Claude Code structured instructions and guardrails that improve the quality of generated documentation.
claude mcp add kodadocs
Follow the wizard to complete the configuration.
Generate Documentation
Once KodaDocs is connected, you can generate documentation directly from your Claude Code session.
Tell Claude Code to generate documentation for your project. KodaDocs will:
- Scan your project directory
- Detect your framework (it supports 20+ including Next.js, Django, Laravel, Rails, Vue, Angular, and more)
- Analyze routes, components, models, and configuration
- Generate a complete VitePress documentation site
The output includes Markdown files, VitePress configuration, sidebar navigation, and search setup. It’s a production ready documentation site.
Why Both MCP and CLI?
I want to explain why KodaDocs uses both an MCP server and a CLI. The MCP server provides the connection to Claude Code. The CLI provides structured commands and context that guide the AI’s behavior.
Think of it this way. The MCP server is the bridge. The CLI is the instruction manual. Together, they produce better results than either would alone. The CLI acts as guardrails that keep the documentation generation focused and accurate.
Step 3: Setting Up Essential Developer MCP Servers
Let me walk through setting up the servers I use daily.
GitHub MCP Server
{
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token"
}
}
}
With this configured, Claude Code can create PRs, review issues, check workflow status, and manage your repos directly.
Example usage: “Create a pull request with the changes I just made, titled ‘Add user settings page’” and Claude Code handles the git operations and PR creation through the GitHub MCP server.
PostgreSQL MCP Server
{
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"env": {
"DATABASE_URL": "postgresql://user:pass@localhost:5432/mydb"
}
}
}
Now Claude Code can query your database directly. “Show me all users who signed up in the last 7 days” becomes an actual database query, executed and returned with results.
Sentry MCP Server
{
"sentry": {
"command": "npx",
"args": ["-y", "@sentry/mcp-server"],
"env": {
"SENTRY_AUTH_TOKEN": "your_sentry_token",
"SENTRY_ORG": "your-org"
}
}
}
This gives Claude Code access to your production error data. “What’s the most common error in the last 24 hours?” pulls real Sentry data and helps you debug faster.
Step 4: Managing Multiple MCP Servers
Running multiple MCP servers simultaneously is common, and Claude Code handles it well.
Lazy Loading with Tool Search
Claude Code’s MCP Tool Search feature is a game changer for multi server setups. It enables lazy loading, which means MCP tools are only loaded into context when needed. This reduces context usage by up to 95%.
Without lazy loading, having 10 MCP servers would flood Claude Code’s context with tool definitions, leaving less room for your actual conversation. With lazy loading, tools are loaded on demand.
Listing Active Servers
Check your current MCP setup:
claude mcp list
This shows all configured servers, their status (running, stopped, errored), and available tools.
Removing a Server
claude mcp remove server-name
Project vs. Global Configuration
- Project level (
.claude.jsonin project root): Servers available only in this project. Best for project specific tools like databases or documentation generators - Global level (
~/.claude.json): Servers available in all projects. Best for universal tools like GitHub, Context7, or filesystem access
Step 5: Practical Workflows
Here are real workflows I use with MCP servers in Claude Code.
Documentation Generation Workflow
- Start a Claude Code session in your project
- Ask Claude Code to generate documentation using KodaDocs
- KodaDocs scans your codebase and produces a VitePress site
- Review the generated docs, request adjustments
- Deploy the VitePress site to your hosting platform
This entire workflow happens within Claude Code. No context switching. No separate tools.
Bug Investigation Workflow
- Ask Claude Code to check Sentry for recent errors (Sentry MCP)
- It identifies a recurring null reference error on the user profile page
- Ask it to find the relevant code (built in file search)
- It reads the component, identifies the bug, and suggests a fix
- Apply the fix and ask Claude Code to create a PR (GitHub MCP)
Four MCP servers working together, all from a single conversation.
Data Exploration Workflow
- Ask Claude Code to show you signup trends (PostgreSQL MCP)
- It queries the database and returns results
- Ask follow up questions about the data
- Ask it to document the findings in your project docs (KodaDocs MCP)
Troubleshooting Common MCP Issues
Server not starting: Check that the command and args in your config are correct. Run the command manually in your terminal to see error output.
Authentication errors: Verify your API keys and tokens are valid. Check that environment variables are properly set in the MCP config.
Tools not appearing: Restart Claude Code after adding new MCP servers. Some servers need a fresh session to register their tools.
Slow responses: Some MCP servers (especially remote ones) add latency. If a server is consistently slow, check your network connection or consider switching to a local alternative.
Context limit issues: If you’re running many MCP servers and hitting context limits, make sure lazy loading is working. Claude Code’s Tool Search should handle this automatically, but verify with claude mcp list.
What’s Next
MCP support in Claude Code is actively evolving. New servers are being published daily, and the protocol itself is maturing with better discovery through the MCP Registry, improved HTTP transport for remote servers, and tighter integration with development workflows.
The developers I know who have adopted MCP report significant productivity gains. Not incremental improvements. Real, measurable differences in how fast they ship features, debug issues, and maintain their projects.
Get ready to connect Claude Code to your entire dev stack. MCP makes it possible. And it’s only getting better.
Want to see what else you can build with MCP? Read our guide on MCP tools for developers, learn how KodaDocs generates help docs as an MCP tool, or explore the full list of open source documentation tools for 2026.
Related articles
MCP Tools for Developers: The Essential Guide for 2026
MCP is quietly becoming the backbone of AI powered development workflows. Here's what it is, why it matters, and which MCP tools are actually worth installing.
Your App Ships Monday. Your Docs Ship Never.
AI coding agents collapsed build time from weeks to hours. User-facing documentation didn't get the memo. Here's why the docs gap is widening, and what to do about it.
MCP Tools Handle Everything — Except Your User Docs
MCP tools have transformed dev workflows into orchestration. But user-facing documentation remains a manual bottleneck for teams shipping fast.