Sunday, April 27, 2025

AI MCP clients, servers, hosts

Model Context Protocol

The terminology of MCP (Model Context Protocol, for AI agents & tools communication) is slightly confusing. 

The "Host" is the app that has AI/LLM functionality, and may need to communicate with external 
resources, tools or even prompts.

The "MCP client" a custom app or a stand-alone app that communicates with MCP "server"

The "MCP server" is usually a lightweight "proxy" app that provide requested resource or invokes tools/functions on demand of MCP client.

The communication between of MCP client & servers can be

  • stdio: when "server" app is started as a process, with input/output/error redirected to "client" app
    that used to be a common on desktop apps, and is relatively simple and efficient for local "server apps"
  • SSE: HTTPS based "streaming"; relatively standard web server API app

Core architecture - Model Context Protocol


What are MCP host apps (with client plugins)
MCP client apps

There is already many MCP servers created and made available.

And there are "online marketplaces" for finding those servers


MCP Servers //mcp.so





Servers | Model Context Protocol | MCP //model-context-protocol.com/servers

some example MCP servers

Caution

MCP servers can run arbitrary code on your machine. Only add servers from trusted sources, and review the publisher and server configuration before starting it.


GitHub - modelcontextprotocol/quickstart-resources: A repository of servers and clients from the Model Context Protocol tutorials


  • AWS KB Retrieval - Retrieval from AWS Knowledge Base using Bedrock Agent Runtime
  • Brave Search - Web and local search using Brave's Search API
  • EverArt - AI image generation using various models
  • Everything - Reference / test server with prompts, resources, and tools
  • Fetch - Web content fetching and conversion for efficient LLM usage
  • Filesystem - Secure file operations with configurable access controls
  • Git - Tools to read, search, and manipulate Git repositories
  • GitHub - Repository management, file operations, and GitHub API integration
  • GitLab - GitLab API, enabling project management
  • Google Drive - File access and search capabilities for Google Drive
  • Google Maps - Location services, directions, and place details
  • Memory - Knowledge graph-based persistent memory system
  • PostgreSQL - Read-only database access with schema inspection
  • Puppeteer - Browser automation and web scraping
  • Redis - Interact with Redis key-value stores
  • Sentry - Retrieving and analyzing issues from Sentry.io
  • Sequential Thinking - Dynamic and reflective problem-solving through thought sequences
  • Slack - Channel management and messaging capabilities
  • Sqlite - Database interaction and business intelligence capabilities
  • Time - Time and timezone conversion capabilities

example: chess engine MCP server (using UCI stdio)

Analyze chess positions and get professional evaluations using Stockfish.
turlockmike/chess-mcp: A MCP Server with various chess functionality @GitHub

Interact with the Lichess chess platform using natural language.

VS Code MCP client extensions

MCP servers can run as public/auth webs servers





here is example setup of Claude Desktop app on Windows machine
it gets "technical" quite quickly :)

this requires enabling "developer" tools from settings (from menu options)

requires editing config file; replace <user> and <folder-path>
C:\Users\<user>\AppData\Roaming\Claude
 
This setup is with Python demo weather MCP server app
using Python directly without virtual envs
make sure to 
> pip install FastMCP

to find file path to Python exe can use this command; 
If python is in "path" env var it may work directly without full path, with just "python" command.
`python -c "import sys; print(sys.executable)"`

{
    "mcpServers": {
        "weather": {
            "command": "C:\\Users\\<user>\\AppData\\Local\\Programs\\Python\\Python312\\python.exe",
            "args": [
                "<folder-path>\weather-server-python\\weather.py"
            ]
        }
    }
}



here we are using TypeScript version of weather demo MCP server app.
for this need to run
> npm install
> npm run build

for setting Cursor.ai desktop app
from menu options select > File > Preferences > Cursor Settings > MCP
[ + Add new global MCP server ]

the path in args should match your local file path to result of build of TypeScript app to index.js

{
  "mcpServers": {
    "weather": {
      "command": "node",
      "args": ["D:\\GitHubTest\\ai-mcp\\quickstart-mcp-weather\\weather-server-typescript\\build\\index.js"]
    }
  }
}

Cursor requires interactive "approval" to run MCP tool, similar to Claude desktop app.



No comments: