Skip to main content
Back to Blog

Getting Started with MCP Servers

aimcpllmautomation

Getting Started with MCP Servers

If you've used GitHub Copilot, Claude, or ChatGPT and thought "this would be so much better if it could actually do things in my environment" — that's what MCP is for.

Model Context Protocol (MCP) is an open standard that lets AI assistants connect to external tools, APIs, and data sources in a structured way. Instead of copy-pasting data into a chat window, the AI can query it directly.

What Problem Does MCP Solve?

LLMs are great at reasoning. They're not great at knowing what's in your database, what your current Kubernetes pod status is, or what's on your calendar. Traditionally you'd bridge that gap with:

  • Copy-pasting context into prompts
  • Writing one-off scripts
  • Custom integrations per AI tool

MCP replaces all of that with a single protocol. You write an MCP server once; any compatible AI client can use it.

Core Concepts

Server: Exposes tools, resources, and prompts. Written in whatever language you like (TypeScript/Node.js is most common right now).

Client: The AI assistant or host that connects to your server and calls its tools.

Tools: Functions the AI can invoke — get_pod_status, query_database, send_message, etc.

Resources: Read-only data the AI can fetch — files, API responses, docs.

A Simple Example

Here's a minimal MCP server in TypeScript that exposes a get_time tool:

import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";

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

server.setRequestHandler("tools/list", async () => ({
  tools: [{
    name: "get_time",
    description: "Get the current date and time",
    inputSchema: { type: "object", properties: {} }
  }]
}));

server.setRequestHandler("tools/call", async (request) => {
  if (request.params.name === "get_time") {
    return {
      content: [{ type: "text", text: new Date().toISOString() }]
    };
  }
  throw new Error("Unknown tool");
});

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

That's it. Run it, point your MCP client at it, and the AI can now ask for the current time via tool call.

Real-World Use Cases

Where MCP gets interesting is when you connect it to things that actually matter:

  • Infrastructure: Query Kubernetes pod status, check node health, tail logs
  • Databases: Let the AI write and run SQL queries against real data
  • Calendar/Email: Pull context from your actual schedule
  • APIs: Wrap any REST API as an MCP tool
  • Home automation: Control Home Assistant devices via natural language

I've found the best MCP servers are the ones that wrap things you already use — existing APIs, CLIs, and services — rather than building something new.

Setting Up for Claude Desktop

Add your server to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "my-server": {
      "command": "node",
      "args": ["/path/to/your/server/dist/index.js"]
    }
  }
}

Restart Claude Desktop and your tools appear automatically.

Tips from the Field

Keep tools focused. One tool that does one thing well beats a multi-purpose tool the AI misuses. Describe each tool accurately — the AI's ability to pick the right tool depends entirely on your descriptions.

Return structured data. If your tool returns JSON, say so and format it consistently. The AI handles structured responses much better than raw text dumps.

Handle errors gracefully. Return helpful error messages, not stack traces. The AI will relay errors to the user, so "Database query failed: table 'users' not found" is much more useful than a 500.

Test with the MCP Inspector. The official MCP Inspector tool lets you call your server's tools directly without an AI client. Essential for debugging.

The Bigger Picture

MCP is still early, but the trajectory is clear: AI assistants that can only chat are giving way to AI agents that can act. The teams building MCP servers now are the ones who'll have AI that actually integrates with their stack — not AI that just talks about it.

If you're doing any kind of systems work, it's worth spending an afternoon setting one up. The learning curve is shallow and the payoff is immediate.