Files
cursor__plugins/plugins/boilerplate/scripts/mcp-server.js
ericzakariasson 5e55a3a3f1 Initial commit: Cursor plugin specification and boilerplate
- Add plugin specification README with complete schema documentation
- Include boilerplate plugin demonstrating all components:
  - Rules (.mdc files with frontmatter)
  - Agents (specialized subagent definitions)
  - Skills (self-contained capabilities with SKILL.md)
  - Hooks (pre/post event automation)
  - MCP servers (external tool integrations)
  - Extensions directory structure

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-01-22 17:54:49 -08:00

69 lines
1.5 KiB
JavaScript

#!/usr/bin/env node
/**
* Example MCP Server
*
* This is a minimal MCP server demonstrating the structure.
* Replace with your actual MCP server implementation.
*/
const { Server } = require('@modelcontextprotocol/sdk/server/index.js');
const { StdioServerTransport } = require('@modelcontextprotocol/sdk/server/stdio.js');
const server = new Server(
{
name: 'example-mcp-server',
version: '1.0.0',
},
{
capabilities: {
tools: {},
},
}
);
// Register example tool
server.setRequestHandler('tools/list', async () => {
return {
tools: [
{
name: 'example_tool',
description: 'An example tool that echoes input',
inputSchema: {
type: 'object',
properties: {
message: {
type: 'string',
description: 'Message to echo',
},
},
required: ['message'],
},
},
],
};
});
server.setRequestHandler('tools/call', async (request) => {
if (request.params.name === 'example_tool') {
const message = request.params.arguments?.message || 'Hello, World!';
return {
content: [
{
type: 'text',
text: `Echo: ${message}`,
},
],
};
}
throw new Error(`Unknown tool: ${request.params.name}`);
});
// Start server
async function main() {
const transport = new StdioServerTransport();
await server.connect(transport);
console.error('Example MCP server running on stdio');
}
main().catch(console.error);