Sponsored by Deepsite.site

🤖 MCP Server

Created By
reynan-deva year ago
MCP Server framework with auto import, valid to use as boilerplate
Content

🤖 MCP Server

This repository contains the Model Context Protocol (MCP) Server used by AI Agents. It is built using the @modelcontextprotocol/sdk, which allows integration with various AI models. The project uses Node.js and TypeScript to provide a robust implementation of the MCP protocol.

The MCP (Model Context Protocol) is a protocol that enables standardized communication between applications and different AI models, making integration easier and more consistent.

🚀 Getting started

To start using the MCP Server, follow these steps:

Prerequisites

  • Node.js version 18 or higher
  • npm

Installation and build

Install dependencies and build the application:

npm install && npm run build

⚙️ MCP Server Configuration

To configure the MCP Server, you'll need to set up some environment variables. Use the .env.example file provided in the project as a reference. Copy it to a new .env file in the project root and adjust the settings as needed:

cp .env.example .env

Make sure to update the values in your .env file to match your specific environment and requirements.

🔌 Integrating with GitHub Copilot

Configuration in VS Code

The project already includes a pre-configured file for GitHub Copilot integration located in the .vscode/mcp.json folder. This is the recommended per-project configuration.

For external projects that want to use this MCP server, copy the following file to the .vscode folder of your project:

"mcp-server": {
  "type": "stdio",
  "command": "node",
  "args": ["${workspaceFolder}/build/index.js"],
  "envFile": "${workspaceFolder}/.env"
}

Alternatively, you can configure Copilot globally in VS Code settings:

  1. Open VS Code Settings (Ctrl+,)
  2. Search for "Copilot: Plugin"
  3. Click "Edit in settings.json"
  4. Add the following configuration:
"github.copilot.plugins": [
  {
    "name": "MCP",
    "command": "npm run start",
    "cwd": "/path/to/your/project/mcp"
  }
]

Replace /path/to/your/project/mcp with the absolute path to your MCP project.

Troubleshooting Common Issues

  • If Copilot does not recognize your plugin, try restarting VS Code.
  • Ensure the MCP SDK version is up to date.
  • Make sure the server is running before attempting to use the tools in Copilot.

🧰 Available Tools

This project comes with example tools:

  • get-alerts: Fetches weather alerts for a U.S. state.
  • get-forecast: Retrieves weather forecasts for specific coordinates.

📝 Testing with GitHub Copilot

After starting the server with npm run start and configuring VS Code, you can test your tools by asking Copilot to use them:

  • "Use the get-forecast tool to get the weather forecast for Detroit."
  • "Fetch weather alerts for California using the get-alerts tool."

🛠️ Creating New Tools

To create a new tool:

  1. Create a new file in the folder src/tools/[tool-name]/[tool-name].tool.ts
  2. Use the following structure as a template:
import { z } from "zod";
import server from "../../utils/server.config.js";

server.addTool(
  "tool-name",
  "Tool description",
  {
    parameter1: z.string().describe("Description of parameter 1"),
    parameter2: z.number().describe("Description of parameter 2"),
  },
  async ({ parameter1, parameter2 }) => {
    // Tool logic here

    return {
      content: [
        {
          type: "text",
          text: "Tool result",
        },
      ],
    };
  }
);
  1. Test the tool by calling it through the MCP Server API or using the provided tools.

📦 Creating New Resources

To create a new resource:

  1. Create a new file in the folder src/resources/[resource-name]/[resource-name].resource.ts
  2. Use the following structure as a template:
import { z } from "zod";
import server from "../../utils/server.config.js";

server.addResource(
  "resource-name",
  "Resource description",
  {
    parameter1: z.string().describe("Description of parameter 1"),
    parameter2: z.number().describe("Description of parameter 2"),
  },
  async ({ parameter1, parameter2 }) => {
    // Resource logic here

    return {
      data: {
        key: "value", // Replace with actual resource data
      },
    };
  }
);
  1. Test the resource by calling it through the MCP Server API or using the provided tools.

📓 Our conventions

Commit types / Branch prefixes

Here is the list of commit types and branch prefixes you can choose from :

Commit TypeTitleDescription
feat✨ FeaturesNew feature
fix🐛 Bug FixesBug fix
docs📚 DocumentationDocumentation only changes
style💎 StylesChanges that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
refactor📦 Code RefactoringA code change that neither fixes a bug nor adds a feature
perf🚀 Performance ImprovementsA code change that improves performance
test🚨 TestsAdding missing tests or correcting existing tests
build🛠 BuildsChanges that affect the build system or external dependencies (example scopes: next, webpack, pnpm)
ci⚙️ Continuous IntegrationsChanges to our CI configuration files and scripts
chore♻️ ChoresOther changes that don't modify src or test files
revert🗑 RevertsReverts a previous commit

Branch names

See the regex validating the branch naming on husky branch-naming script.

Structure :

<type>/<short-description>

Examples :

feat/signup-page
ci/github-actions-setup
fix/calendar-input-focus-not-working

Commit messages

Structure :

<type>(optional scope): <description>

Examples :

ci(front): setup storybook tests
fix: send cors headers
feat(groups): add comment section
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
CursorThe AI Code Editor
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
WindsurfThe new purpose-built IDE to harness magic
Playwright McpPlaywright MCP server
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Amap Maps高德地图官方 MCP Server
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
Tavily Mcp
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
RedisA Model Context Protocol server that provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
DeepChatYour AI Partner on Desktop
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Serper MCP ServerA Serper MCP Server
ChatWiseThe second fastest AI chatbot™
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。