Model Context Protocol (MCP) Implementation

by AshikNesin

303 downloads
Not rated
GitHub

About

This project implements the Model Context Protocol (MCP) for building AI tools. It provides a modular framework that can be used to create MCP-compatible servers and clients, enabling AI assistants to interact with external tools and data sources.

Details

Author
AshikNesin
Downloads
303
Categories
Other

- JSON-RPC 2.0 message handling and protocol initialization
- Tool registration with JSON Schema and invocation
- STDIO and HTTP+SSE transport support
- Capability negotiation and tool list change notifications
- Standardized error handling and structured tool results
- Example calculator tool and test clients

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Model Context Protocol (MCP) Implementation
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install Node.js 20.x or later, clone the repository, run npm install, then use provided scripts like npm run server:stdio and npm run client:stdio to run examples. Developers can create custom servers using the McpServer class and register tools with JSON Schema definitions.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "model context protocol (mcp) implementation": {
            "learn-mcp-by-building": {
                "command": "node",
                "args": [
                    "src/examples/stdio-server.js"
                ]
            }
        }
    }
}

McpServers

{
    "learn-mcp-by-building": {
        "command": "node",
        "args": [
            "src/examples/stdio-server.js"
        ]
    }
}

Model Context Protocol (MCP) Implementation

This project implements the Model Context Protocol (MCP) for building AI tools. It provides a modular framework that can be used to create MCP-compatible servers and clients.

---

🔍 What is Model Context Protocol (MCP)?

The Model Context Protocol (MCP) is an open protocol that enables AI assistants to interact with external tools and data sources.

<details>
<summary><b>Key Features</b></summary>

- List available tools and their capabilities
- Call tools with parameters
- Handle errors in a consistent way
- Process tool results in a standardized format
</details>

📚 For a detailed overview, see MCP Notes.

---

✨ Features

| Category | Features |
|----------|----------|
| Core | ✅ JSON-RPC 2.0 message handling<br>✅ Protocol initialization<br>✅ Capability negotiation |
| Tools | ✅ Tool registration with JSON Schema<br>✅ Tool invocation and validation<br>✅ Standardized error handling |
| Transport | ✅ STDIO support<br>✅ HTTP+SSE Support |
| Testing | ✅ Test clients |

---

📁 Project Structure

src/
├── core/           # Core MCP server implementation
├── transports/     # Transport layer implementations (stdio, HTTP+SSE)
├── tools/          # Tool definitions and handlers
├── examples/       # Example servers and clients
│   └── public/     # Static files for HTTP server
└── index.js        # Main entry point for the library

---

🚀 Getting Started

Prerequisites

- Node.js 20.x or later
- npm or pnpm

Installation

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.