An example MCP server using Typescript
https://github.com/johnleider/mcp.git
Machine Context Protocol (MCP) server.
This is a Model Context Protocol (MCP) server implementation that allows AI assistants like Claude to interact with your custom tools and resources. The server is built using the official @modelcontextprotocol/sdk package and provides a modular architecture for adding custom capabilities.
This MCP server runs as a Node.js application and communicates over stdio, making it compatible with VS Code's MCP integration. It's designed to be extensible, allowing you to add custom tools, resources, and prompts to enhance AI capabilities in your development workflow.
# Install dependencies
pnpm install
# Build the project
pnpm run build
# Start the server
pnpm start
To use this MCP server with VS Code, add the following to your .vscode/mcp.json file (or move it to settings.json for global usage):
{
"servers": {
"my-mcp-server": {
"command": "node",
"args": ["/absolute/path/to/mcp/dist/index.js"],
"env": {}
}
}
}
Make sure to replace /absolute/path/to with the actual absolute path to the mcp directory.
Additionally, ensure that automatic discovery is enabled in your settings.json file:
{
"chat.mcp.discovery.enabled": true
}
You can also verify the discovery and configuration by using the command palette in VS Code:
Ctrl + Shift + P (or Cmd + Shift + P on macOS).MCP.This MCP server provides a structured foundation for building custom tools and capabilities for AI assistants with:
mcp/
โโโ src/
โ โโโ index.ts # Main entry point, server initialization
โ โโโ prompts/ # Prompt registration and management
โ โ โโโ index.ts # Prompt registration module
โ โโโ resources/ # Resource definitions and handlers
โ โ โโโ index.ts # Resource registration module
โ โโโ tools/ # Tool implementations
โ โโโ index.ts # Tool registration module
โโโ .github/ # GitHub-specific files
โ โโโ FUNDING.yml # Sponsorship configuration
โโโ eslint.config.js # ESLint configuration
โโโ package.json # Project metadata and dependencies
โโโ pnpm-lock.yaml # Dependency lock file
โโโ tsconfig.json # TypeScript configuration
โโโ README.md # Project documentation
To add new features or extend existing ones:
This project uses the @modelcontextprotocol/sdk package to create a Machine Context Protocol server that Claude can interact with. The MCP architecture enables Claude to:
McpServerMIT