Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Example MCP Servershow me my system specs and node version"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Example MCP Server
A complete Model Context Protocol (MCP) server implementation in Node.js + TypeScript that integrates with Claude Desktop as a local tool.
What is MCP?
The Model Context Protocol (MCP) is a standardized protocol that enables large language models (like Claude) to safely interact with external tools and data sources. MCP servers expose capabilities (tools) that Claude can discover and invoke in real-time during conversations.
Key Features of MCP:
Tool Discovery: Claude can query available tools and their parameters
Safe Execution: Structured JSON-RPC messages with validation
Stdio Transport: For local integration with Claude Desktop
Extensible: Easy to add new tools with standardized interfaces
Project Structure
example-mcp-server/
├── src/
│ ├── mcp/
│ │ └── server.ts # MCP server with stdio transport
│ ├── tools/
│ │ ├── index.ts # Tool registry & dispatcher
│ │ ├── ping.ts # Ping tool (health check)
│ │ └── system_info.ts # System info tool
│ └── types/
│ └── index.ts # Type definitions
├── package.json # Dependencies & scripts
├── tsconfig.json # TypeScript config
├── mcp.json # Claude Desktop manifest
└── README.md # This fileGetting Started
Prerequisites
Node.js 18+ (LTS)
npm or yarn
Claude Desktop (for testing)
Installation
Clone or navigate to the project directory:
cd example-mcp-serverInstall dependencies:
npm installBuild the TypeScript code:
npm run buildThis compiles all .ts files in src/ to JavaScript in the dist/ folder.
Running the MCP Server
npm startThe server will start listening on stdin/stdout, ready to receive JSON-RPC messages.
Testing the Server Locally
Using curl with echo (Windows PowerShell)
Test the tools/list endpoint:
$message = @{
jsonrpc = "2.0"
id = 1
method = "tools/list"
} | ConvertTo-Json -Compress
"$message" | node dist/mcp/server.jsUsing a Node.js test script
Create test.js:
import { spawn } from "child_process";
const server = spawn("node", ["dist/mcp/server.js"]);
let output = "";
server.stdout.on("data", (data) => {
const line = data.toString().trim();
if (line) {
console.log("Response:", JSON.parse(line));
server.kill();
}
});
server.on("close", () => {
console.log("Server closed");
});
// Send initialize request
const initMsg = {
jsonrpc: "2.0",
id: 1,
method: "initialize",
params: {
protocolVersion: "2024-11-05",
capabilities: {},
clientInfo: { name: "test-client", version: "1.0.0" },
},
};
server.stdin.write(JSON.stringify(initMsg) + "\n");
// Wait a moment, then send tools/list
setTimeout(() => {
const listMsg = { jsonrpc: "2.0", id: 2, method: "tools/list" };
server.stdin.write(JSON.stringify(listMsg) + "\n");
}, 100);Run with:
npm run build && node test.jsAvailable Tools
1. ping
A simple health check tool.
Request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "ping",
"arguments": {}
}
}Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"output": "pong"
}
}2. system_info
Returns system and platform information.
Request:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "system_info",
"arguments": {}
}
}Response:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"output": {
"platform": "win32",
"arch": "x64",
"nodeVersion": "v20.10.0",
"osType": "Windows_NT",
"osRelease": "10.0.22621",
"totalMemory": "16384 MB",
"freeMemory": "8192 MB",
"cpuCount": 8,
"uptime": "24 hours"
}
}
}Registering with Claude Desktop
To make this MCP server available in Claude Desktop:
Windows
Open
%APPDATA%\Claude\claude_desktop_config.jsonAdd this server configuration:
{
"mcpServers": {
"example-mcp-server": {
"command": "node",
"args": ["C:\\path\\to\\example-mcp-server\\dist\\mcp\\server.js"]
}
}
}Replace C:\path\to\example-mcp-server with the actual full path to your project.
macOS
Open
~/Library/Application Support/Claude/claude_desktop_config.jsonAdd the server configuration (use POSIX paths)
Linux
Open
~/.config/Claude/claude_desktop_config.jsonAdd the server configuration
Example Configuration
{
"mcpServers": {
"example-mcp-server": {
"command": "node",
"args": ["C:\\Users\\YourUsername\\projects\\example-mcp-server\\dist\\mcp\\server.js"]
}
}
}Restart Claude Desktop for the changes to take effect
In Claude, look for the tool icon or mention "use the ping tool" or "check system info"
Adding New Tools
To add a new tool:
Create a tool file in
src/tools/(e.g.,src/tools/my_tool.ts):
import { ToolHandler } from "../types/index.js";
export const myToolHandler: ToolHandler = async (args) => {
// Implement your tool logic
return { result: "Your result here" };
};
export const myToolDefinition = {
name: "my_tool",
description: "Description of what your tool does",
inputSchema: {
type: "object",
properties: {
param1: { type: "string", description: "First parameter" },
param2: { type: "number", description: "Second parameter" },
},
required: ["param1"],
},
};Register it in :
import { myToolHandler, myToolDefinition } from "./my_tool.js";
const registry: ToolRegistry = {
// ... existing tools
my_tool: {
definition: myToolDefinition,
handler: myToolHandler,
},
};Rebuild and restart:
npm run build
npm startMCP Protocol Overview
The server implements the MCP specification with support for:
initialize: Handshake with client
tools/list: Returns available tools and schemas
tools/call: Executes a tool with provided arguments
All communication uses JSON-RPC 2.0 format with structured error handling.
Troubleshooting
Server won't start
Ensure Node.js 18+ is installed:
node --versionCheck TypeScript compiled correctly:
npm run buildVerify
dist/mcp/server.jsexists
Claude Desktop doesn't see the server
Double-check the path in
claude_desktop_config.jsonis correct and absoluteRestart Claude Desktop after updating config
Check server runs locally:
npm start
Tool calls fail
Ensure tool name matches exactly (case-sensitive)
Verify required parameters are provided
Check error message in JSON-RPC response
Scripts
npm run build # Compile TypeScript to dist/
npm start # Run the MCP server
npm run dev # Build and run in one commandLicense
MIT
References
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.