Using MCP Servers
Connecting agents to databases, GitHub, Jira, and other services via existing MCP servers
Overview
You do not need to build MCP servers to benefit from MCP. The ecosystem already offers dozens of pre-built servers for popular services -- GitHub, Jira, PostgreSQL, Slack, filesystem access, and more. This lesson shows you how to find, configure, and use existing MCP servers with Claude Code and other agent tools. By the end, you will know how to extend your agent's capabilities by adding a few lines of configuration.
Finding MCP Servers
The MCP ecosystem has grown rapidly since the protocol's release. There are several places to discover available servers:
- Official MCP server registry -- the
modelcontextprotocolGitHub organization maintains a collection of reference servers - npm registry -- search for packages under the
@modelcontextprotocolscope - Community repositories -- many developers publish MCP servers for niche services
- Your agent's documentation -- Claude Code, Cursor, and other tools often list recommended servers
Some of the most commonly used servers include:
| Server | What It Does |
|---|---|
@modelcontextprotocol/server-github | Interact with GitHub repos, issues, PRs |
@modelcontextprotocol/server-postgres | Query PostgreSQL databases |
@modelcontextprotocol/server-filesystem | Read and write files outside the project |
@modelcontextprotocol/server-slack | Send and read Slack messages |
| Community Jira servers | Create and manage Jira tickets |
| Community search servers | Web search, documentation search |
Configuration Anatomy
MCP server configuration lives in a JSON settings file. The exact location depends on your agent, but the structure is consistent. Here is the anatomy of a server configuration entry:
Each entry in mcpServers has:
- Key (
server-name) -- a unique identifier you choose; this is how you refer to the server in logs and diagnostics command-- the executable to run (e.g.,npx,node,python)args-- command-line arguments passed to the executableenv-- environment variables set for the server process (this is where credentials go)
For SSE-based remote servers, the configuration uses a url field instead of command:
Configuration Scopes in Claude Code
Claude Code supports three levels of MCP configuration, each with a different scope:
Three MCP configuration scopes: User Settings (~/.claude/settings.json, all projects, just you), Project Settings (.claude/settings.json, this project, all team members), and Project Local Settings (.claude/settings.local.json, this project, just you). All three merge into the agent's combined server configuration.
User settings (~/.claude/settings.json) apply to every project you work on. Put personal utility servers here -- things like a web search server or a personal note-taking tool.
Project settings (.claude/settings.json) are committed to version control. Every team member who clones the repo gets these servers automatically. This is the right place for project-specific servers like a database connector or a Jira integration.
Project local settings (.claude/settings.local.json) are gitignored. They override project settings on your machine only. Use this for credentials, personal preferences, or servers you are testing before sharing with the team.
Best practice: Put server configurations in project settings (
.claude/settings.json) so the whole team benefits, and put sensitive credentials in environment variables or project local settings (.claude/settings.local.json).
Connecting to GitHub
Let us walk through a concrete example: configuring the GitHub MCP server so your agent can create issues, read pull requests, and search code.
Step 1: Create a GitHub personal access token with the scopes you need (typically repo, issues, and pull_requests).
Step 2: Add the server configuration to your project settings:
Step 3: Set the environment variable in your shell profile or .env file:
Step 4: Restart your agent. Claude Code will detect the new server configuration, start the server process, and discover its tools during initialization.
Now your agent can do things like:
- "Create an issue for the login timeout bug"
- "Show me the open pull requests"
- "Search for all files that import the auth module"
The agent sees these as regular tools and uses them naturally during conversation.
Connecting to a Database
Database MCP servers let your agent query your development or staging databases directly. This is powerful for debugging, data exploration, and understanding schema relationships.
Once configured, you can ask your agent things like:
- "Show me the schema for the users table"
- "How many orders were placed yesterday?"
- "Find all customers who signed up but never made a purchase"
Warning: Be cautious connecting agents to production databases. Use read-only credentials and connect to development or staging environments. Some database MCP servers support a read-only mode that blocks all write operations.
Connecting Multiple Servers
The real power of MCP emerges when you connect multiple servers. An agent with access to GitHub, a database, and Jira can handle complex workflows that span multiple systems:
With this configuration, the agent can handle requests like "Find the Jira ticket for the payment bug, look at the related pull request on GitHub, and check the database to see how many users are affected." The agent orchestrates across all three servers seamlessly.
Cross-server workflow sequence: the human asks about a payment bug. The agent queries Jira for the issue details, GitHub for the related pull request, and the database for a count of affected users, then synthesizes a complete answer spanning all three systems.
Telling Agents About MCP Servers in CLAUDE.md
Configuration alone makes MCP servers available. But to make the agent use them effectively, you should document the servers in your CLAUDE.md file. This connects the server capabilities to your project's specific workflows:
This is where the lessons from earlier modules converge. Your CLAUDE.md provides the context. Your MCP configuration provides the capabilities. Together, they give the agent both the knowledge of what to do and the tools to do it.
Troubleshooting Common Issues
When an MCP server is not working as expected, check these common failure points:
-
Server not starting -- verify the command and args are correct by running them manually in your terminal. Check that the package is installable (
npx -y @modelcontextprotocol/server-github --help). -
Authentication failures -- confirm environment variables are set. Remember that
$GITHUB_TOKENin settings.json means "read from the environment variableGITHUB_TOKEN" -- the actual value must be set in your shell. -
Tools not appearing -- restart your agent after changing configuration. The server is only initialized once at startup. Check your agent's logs for initialization errors.
-
Permission errors -- some agents require you to explicitly allow MCP server commands. In Claude Code, you may need to approve the server's command the first time it runs.
-
Conflicting servers -- if two servers expose tools with the same name, the agent may get confused. Use distinct server names and check for tool name collisions.
Debugging tip: Most MCP clients can show you the list of connected servers and their discovered tools. In Claude Code, the startup output shows which servers were initialized and how many tools each one provides.
Summary
Using existing MCP servers is the fastest way to extend your agent's capabilities. Configure servers in your project's .claude/settings.json to share them across the team, keep credentials in environment variables, and document the available servers in your CLAUDE.md so agents know when and how to use them. The combination of multiple servers -- GitHub for code, a database for data, Jira for project management -- enables agents to handle complex, cross-system workflows that would otherwise require manual orchestration. In the next lesson, we will move from using servers to building your own.