π€ MCP Server
About
MCP Server framework with auto import, valid to use as boilerplate
Details
- Author
- reynan-dev
- Downloads
- 208
- Categories
- Developer Tools
Jump to
- Built with TypeScript and the @modelcontextprotocol/sdk
- Includes example tools: get-alerts and get-forecast for weather data
- Supports adding custom tools and resources via structured templates
- Integrates with GitHub Copilot in VS Code
- Uses stdio transport for communication with Copilot
- Configurable via environment variables
Install Node.js 18+, run npm install && npm run build, copy .env.example to .env and configure environment variables. Start with npm run start. Integrate with GitHub Copilot in VS Code using the provided stdio configuration in .vscode/mcp.json or via global settings.
π€ 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",
},
],
};
}
);
3. 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
},
};
}
);
3. 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 Type | Title | Description |
| ----------- | --------------------------- | :----------------------------------------------------------------------------------------------------- |
| feat | β¨ Features | New feature |
| fix | π Bug Fixes | Bug fix |
| docs | π Documentation | Documentation only changes |
| style | π Styles | Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) |
| refactor | π¦ Code Refactoring | A code change that neither fixes a bug nor adds a feature |
| perf | π Performance Improvements | A code change that improves performance |
| test | π¨ Tests | Adding missing tests or correcting existing tests |
| build | π Builds | Changes that affect the build system or external dependencies (example scopes: next, webpack, pnpm) |
| ci | βοΈ Continuous Integrations | Changes to our CI configuration files and scripts |
| chore | β»οΈ Chores | Other changes that don't modify src or test files |
| revert | π Reverts | Reverts 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
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





