MCP Learning

MCP Learning

A learning-focused MCP server that demonstrates how to build arithmetic tools for AI assistants, currently featuring addition functionality with structured input/output.

Category
Visit Server

README

MCP Learning

A Model Context Protocol (MCP) server that provides arithmetic tools for AI assistants like Claude.

Features

  • Add Tool: Add two numbers together with structured input/output

Installation

Prerequisites

  • Node.js 18 or higher
  • npm, yarn, or pnpm

From Git Repository

# Clone the repository
git clone https://github.com/sadjad-chrono/mcp-learning.git
cd mcp-learning

# Install dependencies
pnpm install
# or
npm install

# Build the project
pnpm build
# or
npm run build

Usage with Claude Desktop

To use this MCP server with Claude Desktop, you need to add it to your Claude configuration file.

Configuration Steps

  1. Locate your Claude Desktop config file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json
  2. Add the server configuration:

Option 1: Using npx (recommended after publishing to npm)

{
  "mcpServers": {
    "mcp-learning": {
      "command": "npx",
      "args": [
        "-y",
        "@sadjadteh-chrono/mcp-learning"
      ]
    }
  }
}

Option 2: Using the built package from cloned repo

After building the project, add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "mcp-learning": {
      "command": "node",
      "args": [
        "/absolute/path/to/mcp-learning/dist/mcpserver/index.js"
      ]
    }
  }
}

Option 3: Development mode with tsx

{
  "mcpServers": {
    "mcp-learning": {
      "command": "npx",
      "args": [
        "-y",
        "tsx",
        "/absolute/path/to/mcp-learning/src/mcpserver/index.ts"
      ]
    }
  }
}
  1. Restart Claude Desktop to load the new configuration.

Verifying the Installation

Once configured and Claude Desktop is restarted:

  1. Open a new conversation in Claude
  2. Look for the šŸ”Œ icon or hammer icon indicating MCP tools are available
  3. Try using the add tool by asking Claude to "add 5 and 3"

Development

Project Structure

mcp-learning/
ā”œā”€ā”€ src/
│   └── mcpserver/
│       └── index.ts          # Main MCP server implementation
ā”œā”€ā”€ dist/                     # Compiled JavaScript (generated)
ā”œā”€ā”€ package.json
ā”œā”€ā”€ tsconfig.json
└── README.md

Available Scripts

# Build the project
pnpm build

# Run in development mode
pnpm dev

# Run in development mode with auto-reload
pnpm dev:watch

# Run with debugger
pnpm debug

# Clean build artifacts
pnpm clean

Testing with MCP Inspector

You can test the server using the MCP Inspector:

npx @modelcontextprotocol/inspector tsx src/mcpserver/index.ts

This will open a web interface where you can interact with your MCP server and test tools.

Adding New Tools

To add new tools to your MCP server, edit src/mcpserver/index.ts:

server.registerTool(
  "tool-name",
  {
    title: "Tool Title",
    description: "What the tool does",
    inputSchema: {
      param1: z.string().describe("Description of param1"),
      // Add more parameters
    },
    outputSchema: { result: z.string() },
  },
  async ({ param1 }) => {
    // Tool implementation
    return {
      content: [{ type: "text", text: "result" }],
      structuredContent: { result: "result" },
    };
  }
);

Publishing to Git

# Initialize git repository (if not already done)
git init

# Add all files
git add .

# Create initial commit
git commit -m "Initial commit: MCP learning server"

# Add remote repository
git remote add origin https://github.com/sadjad-chrono/mcp-learning.git

# Push to GitHub
git push -u origin main

Publishing to npm

Prerequisites

  1. Create an npm account at https://www.npmjs.com/signup
  2. Login to npm: npm login

Publish Steps

# Build the package
pnpm build

# Publish to npm (scoped packages are public by default for free accounts)
npm publish --access public

Note: The --access public flag is required for scoped packages on free npm accounts.

Then users can install with:

npm install -g @sadjadteh-chrono/mcp-learning
# or use with npx
npx @sadjadteh-chrono/mcp-learning

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured