We welcome contributions to the Copilot MCP Server! This document outlines the process for contributing to the project.
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR-USERNAME/copilot-mcp-tool.git - Install dependencies:
npm install - Build the project:
npm run build
- Create a new branch for your changes:
git checkout -b feature/your-feature-name - Make your changes
- Run
npm run lintto ensure code style compliance (we use Biome) - Run
npm run lint:fixto automatically fix formatting issues - Commit your changes with clear commit messages
- Submit a pull request
This project uses Biome for linting and formatting:
- Run
npm run lintto check for issues - Run
npm run lint:fixto auto-fix issues - Run
npm run formatto format code - All commits should pass linting
src/
├── copilot/ # Main Copilot CLI integration
│ ├── index.ts # Entry point
│ ├── server.ts # Server configuration
│ ├── cli.ts # Copilot CLI execution
│ ├── session.ts # Session management
│ ├── constants.ts # Configuration & models
│ ├── types.ts # Type definitions
│ ├── tools/ # MCP Tools
│ └── resources/ # MCP Resources
├── server/ # MCP Server core
├── shared/ # Shared utilities
└── types.ts # Global types
To add a new tool to the Copilot MCP Server:
- Create a new file in
src/copilot/tools/(e.g.,src/copilot/tools/my-tool.ts) - Implement the tool following the pattern of existing tools
- Export a registration function:
export function registerMyTool(server: McpServer): void - Register it in
src/copilot/tools/index.ts
Example:
import { z } from 'zod';
import type { McpServer } from '../../server/mcp.js';
import type { CallToolResult } from '../../types.js';
import { checkCopilotInstalled, executeCopilotCommand, createErrorResult } from '../cli.js';
export function registerMyTool(server: McpServer): void {
server.registerTool(
'my-tool',
{
title: 'My Tool',
description: 'Description of what this tool does',
inputSchema: {
param1: z.string().describe('Parameter description')
}
},
async ({ param1 }): Promise<CallToolResult> => {
try {
const isInstalled = await checkCopilotInstalled();
if (!isInstalled) {
return createNotInstalledError();
}
const prompt = `Your prompt here: ${param1}`;
const result = await executeCopilotCommand(prompt);
return { content: [{ type: 'text', text: result }] };
} catch (error) {
return createErrorResult(error);
}
}
);
}To add new AI models:
- Update the
SUPPORTED_MODELSarray insrc/copilot/constants.ts - Models will automatically be available in all tools that support model selection
- Follow the existing code style (Biome will help ensure this)
- Keep changes focused and atomic
- Provide a clear description of changes in the PR
- Reference any related issues
- Test your changes thoroughly
While the project doesn't have comprehensive automated tests yet, you should:
- Build the project:
npm run build - Run the test harness:
node test-detailed.js - Verify the server starts and responds to MCP requests
- Use the GitHub issue tracker
- Search existing issues before creating a new one
- Provide clear reproduction steps and environment details
This project follows our Code of Conduct. Please review it before contributing.
By contributing, you agree that your contributions will be licensed under the MIT License.
Feel free to open an issue or discussion if you have questions about contributing!