This TypeScript-based server implementation for Model Context Protocol (MCP) provides seamless integration tools for services like JIRA and TODO management, allowing for structured communication between AI models and various productivity tools.
To get started with the MCP server, follow these steps:
Clone the repository:
git clone https://github.com/username/mcp-servers.git
cd mcp-servers
Install dependencies:
npm install
Build the project:
npm run build
To configure the JIRA integration tool:
Create a configuration file in the src/config
directory:
// src/config/jira-tool.config.ts
import { JIRA_TOOL } from '../constant/tool-name';
import { jiraIssueSchema } from '../schema/jira';
import { handleCreateIssue } from '../tools/jira/create-issue';
export const jiraToolConfig = {
name: "JIRA",
version: "1.0.0",
tools: [
{
name: JIRA_TOOL.CREATE_ISSUE,
schema: jiraIssueSchema,
handler: handleCreateIssue,
},
],
};
Make sure to include your JIRA API credentials in your environment variables:
JIRA_API_TOKEN=your_jira_api_token
JIRA_USERNAME=your_jira_username
JIRA_URL=https://your-domain.atlassian.net
Configure the TODO management tool:
// src/config/todo-tool.config.ts
import { TODO_TOOL } from '../constant/tool-name';
import { todoSchema } from '../schema/todo';
import { handleCreateTodo } from '../tools/todo/create-todo';
export const todoToolConfig = {
name: "TODO Manager",
version: "1.0.0",
tools: [
{
name: TODO_TOOL.CREATE_TODO,
schema: todoSchema,
handler: handleCreateTodo,
},
],
};
To start the MCP server:
// src/index.ts
import { MCPServerToolManager } from './server/mcp-server-tool-manager';
import { jiraToolConfig } from './config/jira-tool.config';
import { todoToolConfig } from './config/todo-tool.config';
const server = new MCPServerToolManager();
// Register tools
server.registerTool(jiraToolConfig);
server.registerTool(todoToolConfig);
// Start the server
server.start({ port: 3000 });
Run the server with:
npm start
To create a JIRA issue through the MCP server:
// Example client request
const response = await fetch('http://localhost:3000/call_tool', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: "create_jira_issue",
arguments: {
summary: "Fix login bug",
description: "Users cannot log in when using Safari browser",
issueType: "Bug",
priority: "High"
}
})
});
const result = await response.json();
console.log(result);
To create a new TODO item:
// Example client request
const response = await fetch('http://localhost:3000/call_tool', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: "create_todo",
arguments: {
title: "Review PR #123",
description: "Check code quality and test coverage",
priority: "medium",
dueDate: "2023-12-31"
}
})
});
const result = await response.json();
console.log(result);
You can extend the MCP server by implementing custom tools:
Define your tool constant:
// src/constant/tool-name.ts
export const CUSTOM_TOOL = {
ACTION: "custom_action"
} as const;
Create a schema for validation:
// src/schema/custom.ts
import { z } from 'zod';
export const customToolSchema = z.object({
parameter1: z.string(),
parameter2: z.number().optional(),
options: z.array(z.string()).optional()
});
Implement the handler:
// src/tools/custom/custom-action.ts
import { z } from 'zod';
import { customToolSchema } from '../../schema/custom';
import { RequestHandlerExtra, CallToolResult } from '../../types';
export const handleCustomAction = async (
args: z.infer<typeof customToolSchema>,
extra: RequestHandlerExtra
): Promise<CallToolResult> => {
// Implementation logic here
return {
content: `Processed custom action with ${args.parameter1}`,
format: "text"
};
};
Create and register the configuration:
// src/config/custom-tool.config.ts
import { CUSTOM_TOOL } from '../constant/tool-name';
import { customToolSchema } from '../schema/custom';
import { handleCustomAction } from '../tools/custom/custom-action';
export const customToolConfig = {
name: "Custom Tool",
version: "1.0.0",
tools: [
{
name: CUSTOM_TOOL.ACTION,
schema: customToolSchema,
handler: handleCustomAction,
},
],
};
Register in your server instance:
server.registerTool(customToolConfig);
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "modular-tool-framework" '{"command":"npx","args":["-y","mcp-server"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"modular-tool-framework": {
"command": "npx",
"args": [
"-y",
"mcp-server"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"modular-tool-framework": {
"command": "npx",
"args": [
"-y",
"mcp-server"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect