Real-world MCP patterns
GitHub, databases, security, and Claude as an MCP server
⏱ Est. ~7 min
01 · Read
Let's look at the MCP servers professional engineers use every day. The most popular ones fall into a few categories: - Code hosting (GitHub — review PRs, create issues, check CI) - Error monitoring (Sentry — find production bugs, view stack traces) - Databases (PostgreSQL, MySQL — query data without leaving Claude) - Project management (Jira, Linear, Notion — read tickets, update status) - Communication (Slack, Gmail — read messages, draft replies)
You don't need them all. Start with one that matches a pain point in your current workflow.
Key points
- GitHub MCP: PRs, issues, CI status
- Sentry MCP: error monitoring, stack traces
- Database MCP: query data with natural language
- Start with one server that solves a real pain point
02 · Code example
Connect Claude to GitHub so it can review PRs, create issues, and see your repos.
Add GitHub
claude mcp add --transport http github https://api.githubcopilot.com/mcp/
Then ask Claude
"Review PR #456 and suggest improvements"
"Show me all open PRs assigned to me"
"Create a new issue for the bug we just found"
After adding the GitHub server, authenticate with /mcp inside Claude Code. Once connected, Claude can read PRs, view diffs, create issues, and interact with your repos — all in natural language.
03 · Code example
Connect Claude to your PostgreSQL database and ask questions in natural language.
Add PostgreSQL
claude mcp add --transport stdio db -- npx -y @bytebase/dbhub \
--dsn "postgresql://readonly:pass@localhost:5432/mydb"
Then ask Claude
"What's our total revenue this month?"
"Show me the schema for the orders table"
"Find customers who haven't purchased in 90 days"
Use a read-only database user to stay safe. Claude runs in your terminal and might modify data if instructed — a read-only connection prevents accidental changes. The database server translates Claude's natural language into SQL.
04 · Read
MCP is powerful — but power comes with responsibility. Before adding any MCP server, ask yourself: do I trust this server?
Anthropic hasn't verified every third-party MCP server. A malicious server could expose your data or run unwanted actions.
Be especially careful with servers that fetch untrusted content — if an MCP server reads web pages, emails, or user-generated content, that content could contain prompt injection attacks that trick Claude into doing something you didn't intend.
Best practices: Use read-only database connections. Store API keys in environment variables (--env), never hardcoded. Only add servers from sources you trust. Use claude mcp get <name> to see which tools a server exposes.
Key points
- Not every third-party MCP server is verified by Anthropic
- Servers that fetch untrusted content carry prompt injection risk
- Use read-only database credentials
- Store API keys in environment variables, never hardcoded
- Only add servers from trusted sources
05 · Read
Plot twist: Claude Code can also be an MCP server. Run claude mcp serve, and other MCP clients (like Claude Desktop) can connect to Claude Code and use its tools — read files, edit, terminal commands, and more.
That means you can use Claude Desktop's visual interface while tapping into Claude Code's ability to read and write files in your project. It bridges the web interface and the terminal tooling.
Key points
- claude mcp serve starts Claude Code as an MCP server
- Other tools (like Claude Desktop) can connect to it
- Exposes Claude Code's tools: Read, Edit, LS, Grep, Bash
- Bridges Claude Desktop's UI with Claude Code's file access
06 · Quiz
You're connecting Claude to a production database via MCP. What permissions should the database user have? Think about what happens if Claude can write data.
- Full admin permissions, maximum capability
- Write permissions but no delete permissions
- No permissions — Claude should never touch the database
- Read-only permissions, to prevent accidental changes
07 · Read
When you started this course, you didn't know what a terminal was. Now you can connect Claude Code to GitHub, databases, error monitoring, project management tools, and more — all through MCP.
The key insight: MCP turns Claude from a local code assistant into a connected workflow engine. It can read your issues, query your data, see your errors, and act on what it finds — all in the same conversation where it's writing your code.
Start with one server. The GitHub MCP is a great first pick — it's free, instantly useful, and shows you the power of Claude reaching beyond your local codebase.
Key points
- MCP turns Claude from a local assistant into a connected workflow engine
- Start with one server that solves a real pain point
- GitHub MCP is a great first pick
- Add more servers as your workflow grows
- Tool Search keeps everything fast no matter how many servers you add
08 · Quiz
An MCP server fetches web pages and emails for Claude to read. What's the security risk you should worry about most?
- Untrusted content could contain prompt injection attacks that trick Claude
- The server might use too much memory
- Claude might respond too slowly
- The server might not support your operating system
09 · Fill in the blank
To start Claude Code as an MCP server that other tools can connect to, run claude mcp _____
Other lessons in this chapter
⚠ The full interactive experience needs JavaScript. Please enable it and reload.
※ This is an independent Traditional Chinese teaching project — not an official Anthropic product. Claude™ is a trademark of Anthropic, PBC.