Skip to main content
Early access — new tools and guides added regularly
🟣 Power User Workflows — Guide 2 of 6
View track
>_ claude codeAdvanced18 min

MCP Servers: Connect Claude Code to Everything

Model Context Protocol lets Claude Code talk to GitHub, Slack, databases, browsers, and more. Learn to set up and combine MCP servers.

What you will build
Claude Code connected to GitHub, a database, and at least one other service via MCP

What MCP (Model Context Protocol) is

Model Context Protocol (MCP) is an open standard that lets AI tools like Claude Code connect to external services and data sources. Think of it as a universal adapter — instead of Claude Code being limited to reading files and running terminal commands, MCP gives it access to GitHub, Slack, Google Drive, databases, web browsers, and dozens of other tools. Before MCP, if you wanted Claude Code to check a GitHub issue, you would have to copy the issue text and paste it into your conversation. With MCP, Claude Code connects directly to the GitHub API and reads the issue itself. Before MCP, if you wanted Claude Code to query your database, you would have to run the query manually and paste the results. With MCP, Claude Code queries the database directly. MCP servers are small programs that expose specific capabilities. Each server handles one domain — there is a GitHub MCP server, a Slack MCP server, a PostgreSQL MCP server, and so on. Claude Code connects to these servers and gains their capabilities as additional tools. The protocol handles authentication, permissions, and data formatting so you do not have to.

Available MCP servers

The MCP ecosystem is growing rapidly. Here are the most useful servers available today. Filesystem: gives Claude Code read and write access to specific directories outside your project. Useful for accessing shared drives, config files, or data directories. GitHub: read issues, pull requests, code reviews, repository contents, and commit history. Write comments, create issues, and review PRs directly from Claude Code. Slack: read messages from channels, search conversation history, and send messages. Google Drive: read documents, spreadsheets, and presentations. Useful for pulling specifications or requirements into your coding context. Databases (PostgreSQL, MySQL, SQLite): query databases directly, inspect schemas, and understand data structures without leaving Claude Code. Puppeteer/Playwright: control a web browser programmatically. Claude Code can navigate to pages, take screenshots, fill forms, and extract data. Memory: gives Claude Code persistent memory across sessions — it can store and recall facts, decisions, and context that would otherwise be lost when you start a new conversation. Each server installs independently and you only enable the ones you need.

Setting up your first MCP server

Let us set up the GitHub MCP server as a practical example. First, ensure you have the GitHub CLI (gh) installed and authenticated: run gh auth status in your terminal. If not authenticated, run gh auth login and follow the prompts. Next, add the MCP server configuration to your Claude Code settings. In your project's .claude/settings.json (or ~/.claude/settings.json for global access), add an mcpServers section with a "github" entry specifying the command to run the server. The typical configuration specifies the npx command to run the @anthropic-ai/mcp-server-github package. Once configured, restart Claude Code. You should see the GitHub tools appear in Claude Code's available capabilities. Test it by asking: "What are the open issues in this repository?" or "Show me the latest pull request." Claude Code will use the GitHub MCP server to fetch this information directly. If it does not work, check three things: is gh authenticated? Is the MCP server configuration in the right file? Is the package installed? Most MCP setup issues come down to authentication or path configuration.

Combining multiple MCPs for powerful workflows

The real power of MCP emerges when you combine multiple servers. Here is a practical example: automated issue triage. Connect GitHub MCP (to read issues), your database MCP (to check customer data), and Slack MCP (to notify your team). Now you can say: "Read the latest 5 GitHub issues. For each one, check our database to see if the reporter is a paying customer. Summarise each issue with priority level and post a summary to the #engineering Slack channel." Claude Code orchestrates across all three services in a single conversation. Another example: documentation from code. Connect GitHub MCP and Filesystem MCP. Ask Claude Code to read the recent PRs, understand what changed, update the documentation files, and create a changelog entry. It reads the code changes from GitHub, writes the docs to your filesystem, and can even create a PR with the updates. A third example: debugging with context. Connect your database MCP and Puppeteer MCP. Ask Claude Code to reproduce a bug report: query the database for the user's data, open the application in a browser, navigate to the relevant page, and screenshot the result. This level of cross-service automation is what makes MCP transformative for productivity.

Security: scoped permissions and approval gates

With great power comes great responsibility. MCP servers give Claude Code access to external systems that may contain sensitive data, and you need to manage this carefully. Every MCP server should follow the principle of least privilege — give it only the access it needs. The GitHub MCP server does not need write access unless you specifically want Claude Code creating issues or PRs. Your database MCP should connect with a read-only user unless you explicitly need write operations. Configure each server's permissions in the MCP server configuration. Most servers support scoped access — you can limit which repositories, channels, tables, or directories are accessible. Claude Code's built-in permission model still applies to MCP actions. When Claude Code wants to use an MCP tool, it asks for your approval just like any other tool use. You can configure your settings to auto-approve certain MCP actions (like reading GitHub issues) while requiring manual approval for others (like posting to Slack). For team environments, establish an MCP policy: which servers are approved, what access level each gets, and who can modify the MCP configuration. Commit your MCP configuration to version control so the team shares a consistent, reviewed setup.

Troubleshooting common MCP issues

MCP server not appearing in Claude Code: the most common cause is a configuration syntax error in settings.json. Validate your JSON with a linter. Check that the mcpServers key is at the correct level in the file. Restart Claude Code after any configuration change — MCP servers are loaded on startup. Authentication failures: most MCP servers rely on existing CLI authentication. The GitHub server needs gh auth, database servers need connection strings, cloud services need environment variables or credential files. Test the underlying authentication independently before blaming the MCP server. Timeout errors: some MCP operations (database queries, web scraping) can be slow. If Claude Code reports a timeout, check if the operation works manually. You may need to increase timeout settings in the MCP configuration or optimise the underlying operation. Permission denied errors: these usually mean the MCP server's credentials do not have the required access level. Check the scoped permissions in your configuration and the underlying service's access controls. Unexpected data format: if Claude Code misinterprets MCP results, the server may be returning data in an unexpected format. Check the MCP server's documentation for output format options. When in doubt, restart Claude Code with a fresh session — MCP state can sometimes become stale during long conversations.

Related Lesson

MCP Servers

This guide is hands-on and practical. The full curriculum covers the conceptual foundations in depth with structured lessons and quizzes.

Go to lesson