← Blog
/
How to set up an MCP server
High-quality human expert data. Now accessible for all on Toloka Platform.
Step-by-step guide for AI developers: connect, build, and deploy MCP servers
Quick definitions
MCP server | A program that exposes tools, resources, or prompts to AI applications through the Model Context Protocol. Can run locally or remotely. |
stdio transport | Runs the MCP server as a local subprocess. The AI client launches the process and communicates through standard input/output. Simplest setup. |
Streamable HTTP | Runs the MCP server as a remote web service. Clients connect over HTTP, enabling hosted deployments and multi-client access. |
Prerequisites
Before you start, you’ll need an MCP client installed: Claude Desktop (macOS, Windows, or Linux), Cursor (AI code editor), Claude Code (command-line tool), or any other MCP-compatible client.
For building your own server, you’ll need a runtime for your chosen language. The examples in this guide use Python 3.10+ (with uv) and Node.js 18+ (with npm), but MCP SDKs also exist for C#, Kotlin, Java, Ruby, and other languages.
Option A: connect to an existing MCP server
The fastest way to start with MCP is connecting a pre-built server to your client. This takes under five minutes and requires no coding.
Example: add Tendem MCP for human expertise
Tendem by Toloka is an MCP server that connects your AI agent to verified human experts. When the agent encounters a task requiring judgment, domain knowledge, or verification it cannot handle alone, it delegates to an expert through a standard MCP tool call. This makes it a practical first server to set up, because it demonstrates MCP’s core value: extending what your AI can do beyond its training data.
Step 1. Create a Tendem account at agent.tendem.ai and generate an API key at agent.tendem.ai/tokens.
Step 2. Open your MCP client configuration.
For Claude Desktop, open Settings, navigate to the Developer section, and click "Edit Config." For Cursor, create or edit .cursor/mcp.json in your project root.
For Claude Code, skip the config file and run a single command:
claude mcp add tendem -e TENDEM_API_KEY=your-api-key -- uvx tendem-mcp
Step 3. Add the server configuration. For Claude Desktop or Cursor:
{
"mcpServers": {
"tendem": {
"command": "uvx",
"args": ["tendem-mcp"],
"env": {
"TENDEM_API_KEY": "your-api-key-here"
}
}
}
}
Step 4. Restart your client. Claude Desktop requires a full restart; Cursor may need a refresh from the MCP settings panel.
Step 5. Verify the connection. You should see the Tendem tools listed in your tools menu. Try asking the assistant to delegate a research task.
Other pre-built servers to try
The official MCP servers repository on GitHub lists hundreds of community and vendor-built servers. Popular starting points include GitHub for repository management, Slack for messaging, Google Drive for documents, PostgreSQL for database queries, and Brave Search for web search. Each follows the same configuration pattern.
Option B: build your own MCP server in Python
If you want to expose custom tools to your AI assistant, building a server takes surprisingly little code.
Step 1: Install the MCP SDK.
pip install mcp
Step 2: Create a minimal server (my_server.py):
from mcp.server.fastmcp import FastMCP
mcp = FastMCP("My first server")
@mcp.tool()
def get_weather(city: str) -> str:
"""Get the current weather for a city."""
return f"The weather in {city} is sunny and 22°C."
@mcp.tool()
def calculate_tip(bill_amount: float, tip_percent: float = 18.0) -> str:
"""Calculate tip amount and total for a restaurant bill."""
tip = bill_amount * (tip_percent / 100)
total = bill_amount + tip
return f"Tip: ${tip:.2f}, Total: ${total:.2f}"
Step 3: Connect to Claude Desktop by adding to your config:
{
"mcpServers": {
"my-server": {
"command": "python",
"args": ["/absolute/path/to/my_server.py"]
}
}
}
Step 4: Restart and test. Ask Claude "What’s the weather in Tokyo?" or "Calculate a 20% tip on a $85 bill."
Option C: build your own MCP server in TypeScript
The TypeScript SDK follows a similar pattern. Initialize a project with npm, install @modelcontextprotocol/sdk, define your tools using the server.tool() method with Zod schemas for parameter validation, and connect via StdioServerTransport. A minimal server with one tool runs in about 25 lines of code.
Deploying to production: local vs remote
The examples above all use stdio transport, where the MCP client launches the server as a local subprocess. This is perfect for development and personal use, but the server only runs when the client is open and only serves one user.
For production deployments, Streamable HTTP transport lets you run the server as a remote web service. Clients connect over HTTP, enabling hosting on cloud infrastructure, serving multiple clients, and scaling horizontally.
The 2026 MCP roadmap explicitly focuses on improving Streamable HTTP for production: better session handling with load balancers, horizontal scaling without state workarounds, and .well-known metadata for server discovery.
Remote MCP (Streamable HTTP) is the better choice for most teams. It requires no local tooling on the client side, so end users don’t need Python, Node.js, or uv installed on their machines. The tradeoff is a slightly more involved setup on the server side. Stdio is useful for quick local prototyping, but for anything shared with a team or deployed in production, remote is the way to go.
Common issues and fixes
Server not appearing after restart. The most common cause is a syntax error in the JSON config file. Validate your JSON at jsonlint.com.
"Command not found" errors. Ensure the Python or Node.js path is correct, or use an absolute path. For uvx commands, make sure uv is installed and on your system PATH.
Environment variables not loading. Verify API keys are set correctly in the env block. Keys are case-sensitive.
Tools not discovered. Some clients require a manual refresh. In Cursor, go to Settings > MCP and click refresh. Claude Desktop requires a full restart.
Node.js version issues. The TypeScript SDK requires Node.js 18+. Run node --version to check.
Adding human expertise to any agent workflow with Tendem
Once you’re comfortable setting up MCP servers, a natural next step is combining multiple servers in a single agent. Most production agents connect to several servers simultaneously: one for data access, one for communication tools, one for code execution.
Tendem fits into this stack as the server your agent calls when it needs something no automated tool can provide: verified facts, domain expert analysis, research synthesis, or judgment on ambiguous decisions. The integration is identical to any other MCP server, just one entry in your config file, but it gives the agent access to capabilities that would otherwise require hiring a specialist or accepting the risk of AI-generated errors.
A typical pattern: the agent gathers data through automated MCP servers (database queries, web search, document retrieval), then delegates verification or analysis to Tendem when confidence is low or the stakes are high. The expert response comes back as structured data with sources and a quality score.
This hybrid architecture, where automated tools handle speed and human experts handle accuracy, is emerging as the standard pattern for production AI agents in 2026.
Frequently asked questions
How do I add an MCP server to Claude Desktop?
Can I use MCP with ChatGPT or Gemini?
What is the difference between stdio and Streamable HTTP?
Do I need to host my MCP server somewhere?
How do I debug MCP connection issues?
Subscribe to Toloka news
Case studies, product news, and other articles straight to your inbox.