Prince of Code </>

Back to blog
·4 min read

MCP : connecting AI to real-world tools

The Model Context Protocol lets AI assistants connect to tools, files, APIs and databases in a structured way.

IAMCPAutomation

Why MCP matters

Language models like Claude or GPT are powerful but isolated. They cannot access your local files, internal APIs or databases without a structured bridge. MCP (Model Context Protocol) is that bridge. It defines a standardised protocol letting an LLM discover and use tools in a safe, predictable way.

A concrete use case

Imagine an AI assistant embedded in your IDE that can read your code, create Jira tickets, query your database or trigger CI pipelines. All of this becomes possible with MCP servers that expose these capabilities as declared tools.

Simplified architecture

An MCP server exposes tools (callable functions), resources (readable data) and prompts (reusable templates). The MCP client (the AI assistant) discovers these capabilities via a handshake and calls them on demand. Communication goes through stdio or SSE.

TypeScript configuration example

Here is how to declare a minimal MCP server exposing a project-reading tool:

typescript
const server = new McpServer({
  name: "portfolio-tools",
  version: "1.0.0",
});

server.tool("getProjects", async () => {
  return {
    content: [
      {
        type: "text",
        text: "Available projects list",
      },
    ],
  };
});