What Is MCP?
1. What Is MCP?
Agents, skills, and hooks gave you ways to customize Claude Code from within. Now it's time to extend it outward, connecting Claude to external databases and services. The bridge is MCP: Model Context Protocol.2. The Limitation
There's one thing Claude Code can't do on its own: reach external data. It can work with your files and run your code, but your database, your APIs, your cloud services are out of reach. That's the limitation MCP is designed to solve.3. MCP: The Translator
Model Context Protocol is a standard that lets Claude connect to external tools through a dedicated server. Think of it as a translator between two parties that speak different languages. You ask Claude a question in natural language. Claude turns that into a tool call. The MCP server executes it and sends the response back. Both sides get what they need.4. The Client-Server Pattern
MCP follows the client-server pattern. The MCP host is the environment Claude Code runs in. It manages multiple clients, each one paired with its own server. Each server connects via the right protocol for its target: HTTPS for web services, TCP for databases, NFS for file systems. Claude handles the natural language side. The MCP layer handles the technical side, translating between what you ask and what the external system understands.5. What MCP Abstracts
The contrast is stark. Without MCP, reaching your database means several manual steps: configure a connection, copy the schema, write SQL, run it in a separate client, copy the results, paste them to Claude, then ask for an explanation. With MCP, it's one conversation. In this chapter you'll work with the Chinook music database. Instead of switching tools to query it, you ask Claude directly: "Show me all artists with more than five albums." Claude handles the rest: schema discovery, query, execution, explanation. All without leaving the conversation.6. How MCP Works
The flow has four steps. You ask Claude. Claude turns your request into a tool call. The MCP server executes it: running the SQL query, calling the API, or accessing the file system. The result comes back through the server and Claude presents it in plain language. Every database query in this chapter follows that path.7. The MCP Ecosystem
The MCP ecosystem covers three areas. Databases: SQLite, PostgreSQL, MySQL. Services like GitHub, Slack, and Google Drive. And utilities including web search and file system access. In this chapter you'll work with the SQLite MCP server to connect Claude to the Chinook music database.8. Why Not Just Use SQL Directly?
But you might be wondering: why not just run SQL directly? SQL via the command line is always an option, so why MCP? The difference is integration. When you run SQL in a terminal, you manage the connection, interpret the results, and manually bring context back to Claude. With MCP, Claude sees the live schema, writes queries that fit the actual tables, runs them, and explains the results, all without leaving the conversation. And because everything stays in one place, Claude can connect what it finds in the database to the rest of your codebase: informing decisions, suggesting changes, keeping the full picture in view. It's not about replacing SQL. It's about making your workflow more cohesive.9. What's Next
Here's the plan for the chapter. This video covered the concept. Next, you'll connect to the Chinook music database. Then you'll build a new endpoint in the Music Analytics API that queries real album data. Finally, you'll test it end to end.10. Let's Practice!
MCP is the bridge between Claude and the outside world. Before building, make sure the concept is clear. Practice time.Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.