Skip to content

PAIshanMadusha/model-context-protocol-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

45 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

mcp icon

MCP (MODEL CONTEXT PROTOCOL) SERVERS

BUILT WITH NODE.JS & TYPESCRIPT, POWERED BY KV & MONGODB

Β Β Β  Β Β 

DEVELOPED & DEPLOYED USING CURSOR β€’ CLOUDFLARE β€’ TESTED WITH CLAUDE AI

Β Β Β Β  Β Β Β Β 


This repository is structured as a monorepo containing three standalone MCP (Model Context Protocol) server implementations mcp-basic, mcp-cloudflare, and mcp-mongo each built for different execution environments and use-cases, These servers can integrate with AI models (e.g., Claude AI) and can be tested using commands and prompts.

πŸ“‘ Table of Contents


πŸ“Œ Monorepo Overview

Project Backend Features Use Cases
mcp-basic Node.js, TypeScript, STDIO Tools, Resources, Prompts Local execution, CLI usage, MCP Inspector integration, Tested with Claude AI
mcp-cloudflare Node.js, TypeScript, Cloudflare KV Task/Todo CRUD tools, KV storage Cloudflare Worker deployment, Remote execution via public endpoint, MCP Inspector, Tested with Claude AI
mcp-mongo Node.js, TypeScript, MongoDB, STDIO Task/Todo CRUD tools with persistence Local execution, CLI usage, Persistent data handling, MCP Inspector, Tested with Claude AI

πŸ“ Repository Structure

The repository is organized using the following structure:

model-context-protocol-server/
│── mcp-basic/         # Simple MCP server with Tools, Prompts, Resources
│── mcp-cloudflare/    # Cloudflare Worker MCP server with KV storage
│── mcp-mongo/         # MCP server with MongoDB persistent storage
│── LICENSE            # MIT License
└── README.md          # (You are reading this file)

πŸ“ Project Directory Layout

The following directory structure is used in this monorepo:

model-context-protocol-server/
β”‚
│── mcp-basic/                          # model-context-protocol-basic (Basic MCP server implementation)
β”‚   β”œβ”€β”€ build/
β”‚   β”œβ”€β”€ node_modules/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ prompts/
β”‚   β”‚   β”‚   └── explainSql.ts
β”‚   β”‚   β”œβ”€β”€ resources/
β”‚   β”‚   β”‚   └── productDetails.ts
β”‚   β”‚   β”œβ”€β”€ seed/
β”‚   β”‚   β”‚   └── product.txt             # Example seed input file
β”‚   β”‚   β”œβ”€β”€ tools/
β”‚   β”‚   β”‚   β”œβ”€β”€ addNumbers.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ divideNumbers.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ githubRepos.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ multiplyNumbers.ts
β”‚   β”‚   β”‚   └── subtractNumbers.ts
β”‚   β”‚   └── index.ts
β”‚   β”œβ”€β”€ .gitignore
β”‚   β”œβ”€β”€ package.json                    # Project dependencies & scripts
β”‚   └── tsconfig.json
β”‚
│── mcp-cloudflare/                     # model-context-protocol-cloudflare (MCP implementation running on Cloudflare Workers)
β”‚   β”œβ”€β”€ node_modules/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”‚   β”œβ”€β”€ schema.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ task.model.ts
β”‚   β”‚   β”‚   └── todo.model.ts
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”‚   β”œβ”€β”€ kv.service.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ task.service.ts
β”‚   β”‚   β”‚   └── todo.service.ts
β”‚   β”‚   β”œβ”€β”€ tools/
β”‚   β”‚   β”‚   β”œβ”€β”€ task.tools.ts
β”‚   β”‚   β”‚   └── todo.tools.ts
β”‚   β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”‚   β”œβ”€β”€ error.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ id.ts
β”‚   β”‚   β”‚   └── time.ts
β”‚   β”‚   └── index.ts
β”‚   β”œβ”€β”€ test/
β”‚   β”œβ”€β”€ .editorconfig
β”‚   β”œβ”€β”€ .gitignore
β”‚   β”œβ”€β”€ .prettierrc
β”‚   β”œβ”€β”€ package.json                    # Project dependencies & scripts
β”‚   β”œβ”€β”€ tsconfig.json
β”‚   β”œβ”€β”€ vitest.config.mts
β”‚   β”œβ”€β”€ worker-configuration.d.ts
β”‚   └── wrangler.jsonc                  # Worker deployment configuration
β”‚
│── mcp-mongo/                          # model-context-protocol-mongo (MCP server backed by MongoDB storage)
β”‚   β”œβ”€β”€ build/
β”‚   β”œβ”€β”€ node_modules/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ db/
β”‚   β”‚   β”‚   └── mongo.ts
β”‚   β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”‚   β”œβ”€β”€ schema.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ task.model.ts
β”‚   β”‚   β”‚   └── todo.model.ts
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”‚   β”œβ”€β”€ task.service.ts
β”‚   β”‚   β”‚   └── todo.service.ts
β”‚   β”‚   β”œβ”€β”€ tools/
β”‚   β”‚   β”‚   β”œβ”€β”€ task.tools.ts
β”‚   β”‚   β”‚   └── todo.tools.ts
β”‚   β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”‚   β”œβ”€β”€ error.ts
β”‚   β”‚   β”‚   └── time.ts
β”‚   β”‚   └── index.ts
β”‚   β”œβ”€β”€ .gitignore
β”‚   β”œβ”€β”€ package.json                    # Project dependencies & scripts
β”‚   └── tsconfig.json
β”‚
│── LICENSE                             # MIT License
└── README.md                           # Project Documentation

πŸš€ 1) MCP Basic Server: Features & Installation

πŸ”₯ Features

The following features are included in the MCP Basic server:

1. πŸ”§ Tools Included

Name Tool Function Description
add-numbers addNumbers Returns the sum of two numeric values
subtract-numbers subtractNumbers Calculates the difference between two values
multiply-numbers multiplyNumbers Multiplies two numeric values
divide-numbers divideNumbers Divides one numeric value by another
get-github-repos githubRepos Retrieves public repos from a provided GitHub username

2. πŸ“„ Resources Available

Name Resource Handler URI File Source Description
product-details Product Details products://all /src/seed/product.txt Provides product data (seed file)

3. πŸ’‘ Prompts Provided

Name Prompt Description Prompt Example
explain-sql-query Generates a beginner-friendly explanation of any provided SQL query using the LLM. Explain this SQL query in simple terms: ${sql} (be beginner-friendly).

βš™ Installation & Local Setup

Follow the steps below to run the MCP Basic server locally:

1. βœ… Clone the repository:

git clone https://github.com/PAIshanMadusha/model-context-protocol-server.git

2. βœ… Navigate to the Basic MCP server:

cd model-context-protocol-server/mcp-basic

3. βœ… Install dependencies:

npm install

4. βœ… Build the application:

npm run build

πŸ§ͺ Run & Test

Below are multiple ways to test this MCP server using Inspector, Cursor, and Claude.

5. 🌐 Test using MCP Inspector (recommended):

npx @modelcontextprotocol/inspector

* After launching: Open the Inspector UI (auto-opens in browser), Click Add MCP Server & Use the following configuration:

Command: node Arguments: build/index.js

* Then click Connect to start testing tools.

6. 🌐 Test using Cursor IDE:

* Open Cursor: Settings β†’ Tools β†’ MCP and add:

"mcpServers": {
  "model-context-protocol-basic": {
    "command": "node",
    "args": ["C:/path/to/model-context-protocol-server/mcp-basic/build/index.js"] // replace with your actual path
  }
}

* Now you can use the tools directly inside Cursor's AI chats.

7. 🌐 Test with Claude AI (Desktop):

* Open Claude: **Settings β†’ Developers β†’ Edit config, Add:

"mcpServers": {
  "model-context-protocol-basic": {
    "command": "node",
    "args": ["C:/path/to/model-context-protocol-server/mcp-basic/build/index.js"] // replace with your actual path
  }
}

* Restart Claude & Start chatting and access the MCP Tools panel.


🌐 2) MCP Cloudflare Worker: Features & Installation

πŸ”₯ Features

This MCP server implementation runs entirely on Cloudflare Workers, offering task & todo management through HTTP-based MCP transport.

1. πŸ”§ Supported Tools: Task Management

Tool Name Function Description
create-task Create Task Creates a new task with title + details and stores it in KV backend.
list-tasks List Tasks Retrieves the full list of stored tasks with metadata and timestamps.
get-task-by-id Retrieve Task Fetches details of a specific task using its unique ID.
update-task-by-id Update Task Updates task fields such as name, status, or description.
delete-task-by-id Delete Task Permanently removes a task from storage using its ID.

2. πŸ”§ Supported Tools: Todo Management

Tool Name Function Description
create-todo Add Todo Creates a new todo item and associates it with a task (parent task required).
list-todos List Todos Retrieves all todo items under a specific task, grouped by task ID.
get-todo-by-id Retrieve Todo Fetches detailed information for a todo item using its ID.
update-todo-by-id Update Todo Updates todo fields such as text, checklist status, or completion progress.
delete-todo-by-id Delete Todo Deletes a specific todo item from its linked task.

3. πŸ—‚ API Endpoints

* 🌍 Example Deployment: (Replace with your own deployment URL)

https://mcp-cloudflare.paishanmadusha.workers.dev

Route Purpose
/mcp REST-based MCP transport
/sse Server-Sent-Events MCP streaming

⚠ Note: Cloudflare free-tier accounts do not allow creation of Worker KV storage, you can still test without storage using mcp-mongo (same tools, MongoDB backend).


βš™ Installation & Local Setup

Follow the steps below to run and deploy the Cloudflare MCP server:

1. βœ… Clone Repository:

git clone https://github.com/PAIshanMadusha/model-context-protocol-server.git

2. βœ… Navigate to Cloudflare MCP Server:

cd model-context-protocol-server/mcp-cloudflare

3. βœ… Install Dependencies:

npm install

4. βœ… Add Worker KV Binding:

* Create a KV namespace in Cloudflare β†’ Storage & Database β†’ Workers KV and enter it in wrangler.toml:

"kv_namespaces": [
		{
			"binding": "MCP_CLOUDFLARE_STORE",
			"id": "b98f377e26184191968cf4a2ad014df5", # replace with yours
			"remote": true
		}
	]

5. βœ… Deploy to Cloudflare:

wrangler deploy

πŸ§ͺ Run & Test

Below are multiple ways to test this MCP server using Inspector, Cursor, and Claude.

6. 🌐 Test with MCP Inspector:

npx @modelcontextprotocol/inspector

* After launching: Open the Inspector UI (auto-opens in browser), Click Add MCP Server & Use the following configuration:

Command: node Arguments: https://mcp-cloudflare.paishanmadusha.workers.dev/mcp

* Then click Connect to start testing tools.

7. 🌐 Test using Cursor IDE:

* Open Cursor: Settings β†’ Tools β†’ MCP and add:

"mcpServers": {
  "model-context-protocol-cloudflare": {
    "command": "node",
    "args": ["https://mcp-cloudflare.paishanmadusha.workers.dev/mcp"]  // replace with your domain
  }
}

* Now you can use the tools directly inside Cursor's AI chats.

8. 🌐 Test with Claude Desktop (Recommended):

* Open Claude: **Settings β†’ Developers β†’ Edit config, Add:

"mcpServers": {
  "model-context-protocol-cloudflare": {
    "command": "node",
    "args": ["https://mcp-cloudflare.paishanmadusha.workers.dev/mcp"]   // replace with your domain
  }
}

* Restart Claude & Start chatting and access the MCP Tools panel.


πŸ“¦ 3) MCP Mongo Server: Features & Installation

πŸ”₯ Features

The following features are included in the MCP Mongo server:

1. πŸ”§ Supported Tools: Task Management

Tool Name Function Description
create-task Create Task Creates a new task with title + details and stores it in MongoDB backend.
list-tasks List Tasks Retrieves the full list of stored tasks with metadata and timestamps.
get-task-by-id Retrieve Task Fetches details of a specific task using its unique ID.
update-task-by-id Update Task Updates task fields such as name, status, or description.
delete-task-by-id Delete Task Permanently removes a task from storage using its ID.

2. πŸ”§ Supported Tools: Todo Management

Tool Name Function Description
create-todo Add Todo Creates a new todo item and associates it with a task (parent task required).
list-todos List Todos Retrieves all todo items under a specific task, grouped by task ID.
get-todo-by-id Retrieve Todo Fetches detailed information for a todo item using its ID.
update-todo-by-id Update Todo Updates todo fields such as text, checklist status, or completion progress.
delete-todo-by-id Delete Todo Deletes a specific todo item from its linked task.

βš™ Installation & Local Setup

Follow the steps below to run the MCP Mongo server locally:

1. βœ… Clone the repository:

git clone https://github.com/PAIshanMadusha/model-context-protocol-server.git

2. βœ… Navigate to the Mongo MCP server:

cd model-context-protocol-server/mcp-mongo

3. βœ… Install dependencies:

npm install

4. βœ… Build the application:

npm run build

πŸ§ͺ Run & Test

Below are multiple ways to test this MCP server using Inspector, Cursor, and Claude.

5. 🌐 Test using MCP Inspector

npx @modelcontextprotocol/inspector

* After launching: Open the Inspector UI (auto-opens in browser), Click Add MCP Server & Use the following configuration:

Command: node Arguments: build/index.js

* Then click Connect to start testing tools.

6. 🌐 Test using Cursor IDE

* Open Cursor: Settings β†’ Tools β†’ MCP and add:

"mcpServers": {
  "model-context-protocol-mongo": {
    "command": "node",
    "args": ["C:/path/to/model-context-protocol-server/mcp-mongo/build/index.js"] // replace with your actual path
  }
}

* Now you can use the tools directly inside Cursor's AI chats.

7. 🌐 Test with Claude Desktop (recommended)

* Open Claude: **Settings β†’ Developers β†’ Edit config, Add:

"mcpServers": {
  "model-context-protocol-mongo": {
    "command": "node",
    "args": ["C:/path/to/model-context-protocol-server/mcp-mongo/build/index.js"] // replace with your actual path
  }
}

* Restart Claude & Start chatting and access the MCP Tools panel.


πŸ‘€ Created By

Ishan Madhusha
GitHub: PAIshanMadusha

Feel free to explore my work and reach out if you'd like to collaborate! πŸš€


πŸ“ License

This project is licensed under the MIT License.
See the LICENSE file for more details.

About

A monorepo containing three independent MCP (Model Context Protocol) servers, implemented using three different runtime environments.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors