https://github.com/ribeirogab/simple-mcp
A simple TypeScript library for creating MCP servers.
https://github.com/ribeirogab/simple-mcp
ai mcp model-context-protocol
Last synced: 28 days ago
JSON representation
A simple TypeScript library for creating MCP servers.
- Host: GitHub
- URL: https://github.com/ribeirogab/simple-mcp
- Owner: ribeirogab
- License: mit
- Created: 2025-03-27T06:25:51.000Z (28 days ago)
- Default Branch: main
- Last Pushed: 2025-03-27T07:18:24.000Z (28 days ago)
- Last Synced: 2025-03-27T07:28:59.604Z (28 days ago)
- Topics: ai, mcp, model-context-protocol
- Language: TypeScript
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-mcp-servers - SimpleMCP - A simple TypeScript library for creating MCP servers. (Table of Contents / Gaming)
- awesome-mcp-servers - SimpleMCP - A simple TypeScript library for creating MCP servers. (Table of Contents / Gaming)
README
# Simple MCP
A simple TypeScript library for creating [MCP](https://modelcontextprotocol.io/) (Model Context Protocol) servers.
## Features
- **Simple API**: Create MCP servers with minimal code
- **Type Safety**: Full TypeScript integration
- **Parameter Validation**: Built-in validation with Zod
- **MCP Compatible**: Fully implements the Model Context Protocol## Installation
```bash
npm install simple-mcp
```## Quickstart
```typescript
import { McpServer } from 'simple-mcp';
import { z } from 'zod';// Create a server instance
const server = new McpServer({ name: 'my-server' });// Add a tool
server.tool({
name: 'greet',
parameters: {
name: z.string().describe('Person\'s name')
},
execute: async ({ name }) => {
return {
content: [
{
type: 'text',
text: `Hello, ${name}!`
}
]
};
}
});// Start the server
server.start({ transportType: 'stdio' });
```## Examples
Check out the [examples directory](https://github.com/ribeirogab/simple-mcp/tree/main/examples) for more complete examples:
- [Greeting Tool](https://github.com/ribeirogab/simple-mcp/tree/main/examples/greet.ts) - Simple greeting example
- [Calculator Tool](https://github.com/ribeirogab/simple-mcp/tree/main/examples/calculator.ts) - Mathematical operations example## Contributing
Contributions are welcome! Feel free to open issues or submit pull requests.
## License
[MIT](LICENSE)