Inside MCP: Develop your first MCP Server
Introduction
We’ve covered what MCP is, how it connects to systems, and how it enables agent workflows. Now, let’s get hands-on.
This guide will show you how to build your first MCP server and how to test/debug it.
Building Your First MCP Server
An MCP server exposes your system (database, API, or service) to an agent. At a glance:
- Define capabilities – decide what your server can do (e.g., list files).
- Implement endpoints – follow the MCP protocol to expose them.
- Run and test – so an MCP-aware agent (or developer tools) can use it.
Example Project: File System MCP Server in Go
A working example is available in this GitHub repo:
👉 inside-mcp/cmd/first/main.go
To try it out:
# Clone the repo
git clone https://github.com/tendant/inside-mcp.git
cd inside-mcp/cmd/first
# Run the server (using the current directory as root by default)
go run .
# Or, set a custom root directory:
MCP_FS_ROOT=/path/to/folder go run .
Testing & Debugging MCP Integrations
MCP servers communicate via JSON-RPC over stdio. Here’s how to test one in practice:
1. Build the server
go build cmd/first/main.go -o first
2. Install mcptools
go install github.com/f/mcptools/cmd/mcptools@latest
3. Use mcptools to explore your server
mcptools tools ./first
mcptools call list_resources ./first
This shows the tools your server exposes and lets you call them directly.
4. Send raw JSON (optional)
You can also pipe JSON directly:
echo '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "list_roots",
"arguments": {}
}
}' | ./first
5. Unit test handlers directly
func TestListResources(t *testing.T) {
args := ResourceParams{Path: "."}
res, data, err := listResources(context.Background(), nil, args)
if err != nil {
t.Fatal(err)
}
if len(data.([]string)) == 0 {
t.Fatal("expected files, got none")
}
}
6. Use the server with Claude Desktop
Claude Desktop supports MCP servers out of the box. To connect your server:
-
Open the Claude Desktop config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%AppData%/Claude/claude_desktop_config.json
- macOS:
-
Add an entry for your MCP server, for example:
{ "mcpServers": { "filesystem": { "command": "/absolute/path/to/first" } } }Replace
/absolute/path/to/firstwith the path to the binary you built earlier. -
Restart Claude Desktop.
Now you can chat with Claude and say:
“List the files in my home directory.”
Claude will call your list_resources tool through MCP and return the results.
Wrapping Up
The simplest path to an MCP integration:
- Build a server (we used Go + the MCP SDK).
- Run it with a system to expose.
- Test it with
mcptools, raw JSON, or unit tests. - Connect it to Claude Desktop to see it in action with a real agent.
With this workflow, you can start small and gradually expand your integration.
In the next article, we’ll explore advanced MCP patterns—scaling multi-agent setups, monitoring traffic, and cross-organization integrations.
You might also like
Inside MCP: Develop your first MCP Server
A step-by-step guide for developers to build and test MCP servers that connect agents with real systems.
Inside MCP: How MCP Connects Agents to Data and Systems
A look at how the Model Context Protocol (MCP) bridges agents with databases, SaaS applications, and legacy systems.
Inside MCP: The Missing Link Between Agents and the Real World
An introduction to the Model Context Protocol (MCP) and how it enables AI agents to connect with real systems, data, and workflows.