How to Use MCP Servers in Claude Code Today: A Practical Guide

How to Use MCP Servers in Claude Code Today: A Practical Guide

MCP is now a core part of Claude Code's workflow. Here's how to install servers and use them to access databases, APIs, and tools directly from your editor.

2d ago·5 min read·5 views·via gn_mcp_protocol, medium_anthropic, hn_mcp, medium_claude, hn_claude_cli, hn_claude_code
Share:

How to Use MCP Servers in Claude Code Today: A Practical Guide

What MCP Actually Does in Your Editor

The Model Context Protocol (MCP) isn't just theoretical—it's changing how Claude Code interacts with your entire development environment. While APIs are deterministic contracts for developers, MCP servers give Claude Code dynamic access to tools, resources, and prompts. This means instead of just generating code, Claude can now:

  • Query your database schema directly
  • Check your calendar for meeting conflicts
  • Search documentation without leaving the editor
  • Access version control history
  • Interact with cloud services

Setting Up Your First MCP Server

Claude Code has built-in MCP client support. Here's how to get started:

  1. Install the MCP CLI (if not already available):
npm install -g @modelcontextprotocol/cli
  1. Add MCP servers to your Claude Code configuration (~/.config/claude-code/config.json or project-specific):
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["@modelcontextprotocol/server-filesystem", "/path/to/your/project"]
    },
    "sqlite": {
      "command": "npx",
      "args": ["@modelcontextprotocol/server-sqlite", "your-database.db"]
    }
  }
}
  1. Restart Claude Code and check the MCP connection status in the bottom status bar.

Essential MCP Servers for Developers

Here are the most useful MCP servers you should install right now:

1. Filesystem Server (Already mentioned above)

  • What it does: Gives Claude Code read/write access to your project files
  • Why it matters: Claude can now navigate your entire codebase contextually, not just what's in the current file

2. Git Server

{
  "git": {
    "command": "npx",
    "args": ["@modelcontextprotocol/server-git"]
  }
}
  • Use case: "Claude, show me what changed in the last commit that broke the tests"
  • Result: Claude can query git history and show you specific changes

3. PostgreSQL/MySQL Server

{
  "postgres": {
    "command": "npx",
    "args": ["@modelcontextprotocol/server-postgres", "postgresql://user:pass@localhost/db"]
  }
}
  • Use case: "Claude, what's the schema of the users table and show me some sample data"
  • Result: Claude can query your database directly, understanding your actual data structure

4. HTTP Server

{
  "http": {
    "command": "npx",
    "args": ["@modelcontextprotocol/server-http"]
  }
}
  • Use case: "Claude, fetch the latest API documentation from our internal wiki"
  • Result: Claude can make HTTP requests to gather context

How to Prompt Claude with MCP Tools

When MCP servers are connected, Claude Code automatically knows what tools are available. But you can be more specific:

Instead of: "Write a SQL query to find inactive users"

Try: "Using the postgres MCP server, query the users table for accounts with no login activity in the last 90 days. Show me the SQL you generate and the results."

Claude will:

  1. Recognize it has database access via MCP
  2. Generate appropriate SQL
  3. Execute it through the MCP server
  4. Return both the query and the results

The Elicitation Pattern: Two-Way Communication

MCP's most powerful feature is elicitation—when Claude needs more information from you to use a tool. For example:

You: "Claude, schedule a meeting about the API redesign"

Claude: "I can use the calendar MCP server to schedule that. What time should the meeting be, and who should I invite?"

This creates a conversational workflow where Claude doesn't just guess parameters—it asks for them, then uses the tools with the correct information.

Building Your Own MCP Servers

If you have internal tools or APIs, you can create custom MCP servers. The basic structure:

// simple-mcp-server.js
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';

const server = new Server(
  { name: 'my-tool-server', version: '1.0.0' },
  { capabilities: { tools: {} } }
);

server.setRequestHandler(
  'tools/list',
  async () => ({
    tools: [
      {
        name: 'deploy_to_staging',
        description: 'Deploy the current branch to staging environment',
        inputSchema: {
          type: 'object',
          properties: {
            force: {
              type: 'boolean',
              description: 'Force deploy even if tests fail'
            }
          }
        }
      }
    ]
  })
);

const transport = new StdioServerTransport();
await server.connect(transport);

Add it to your config:

{
  "deploy": {
    "command": "node",
    "args": ["/path/to/simple-mcp-server.js"]
  }
}

Now you can say: "Claude, deploy this to staging" and it will use your internal deployment tool.

Performance Considerations

MCP servers run locally or connect to your services. This means:

  • No data leaves your environment (for local servers)
  • Latency depends on your connections
  • You control authentication and security

Start with read-only servers (filesystem, git) before adding write capabilities.

Next Steps

  1. Install the filesystem and git servers today—they're safe and immediately useful
  2. Experiment with one database server for your main project
  3. Watch the MCP GitHub repository for new servers
  4. Consider building a simple MCP server for your team's most common workflow

MCP transforms Claude Code from a code generator to a true development assistant that understands and interacts with your entire environment. The protocol is stable, the servers are maturing, and the workflow improvements are real.

AI Analysis

Claude Code users should immediately configure at least the filesystem MCP server. This gives Claude contextual awareness of your entire project, not just the current file. When asking Claude to refactor code or understand dependencies, it can now examine related files directly. Start using elicitation in your prompts. Instead of providing all parameters upfront, let Claude ask for what it needs. Try: "Claude, help me debug the authentication issue" rather than "Claude, here's the error log and here's the code..." Claude will use MCP tools to gather the necessary context. Build a custom MCP server for your team's deployment or testing workflow. Even a simple server that runs your test suite or linter gives Claude much more capability than just generating code. The investment is small (a simple Node script) but the payoff in workflow automation is significant.
Original sourcenews.google.com

Trending Now

More in Opinion & Analysis

View all