Supports publishing the MCP server as an npm package that can be installed and used by others through the npm registry.
Provides a TypeScript-based framework for building MCP tools with type safety and validation through the project structure.
Integrates Zod schema validation to define and validate input parameters for MCP tools, ensuring type safety and proper data handling.
my-mcp-server
A Model Context Protocol (MCP) server built with mcp-framework.
Quick Start
Related MCP server: Calculator MCP Server
Project Structure
Adding Components
The project comes with an example tool in src/tools/ExampleTool.ts. You can add more tools using the CLI:
Tool Development
Example tool structure:
Publishing to npm
Update your package.json:
Ensure
nameis unique and follows npm naming conventionsSet appropriate
versionAdd
description,author,license, etc.Check
binpoints to the correct entry file
Build and test locally:
npm run build npm link my-mcp-server # Test your CLI locallyLogin to npm (create account if necessary):
npm loginPublish your package:
npm publish
After publishing, users can add it to their claude desktop client (read below) or run it with npx
After Publishing
Add this configuration to your Claude Desktop config file:
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
Building and Testing
Make changes to your tools
Run
npm run buildto compileThe server will automatically load your tools on startup