Simple MCP (Model Context Protocol) HTTP Server with two example tools.
# Run with default port 9091
go run main.go
# Run with custom port
go run main.go -port 9092Server URL: http://127.0.0.1:9091/mcp
Returns current server time in RFC 3339 format.
Counts characters, words, and lines in text.
Input:
- text (string, required)
curl http://localhost:9091/healthcurl -X POST http://localhost:9091/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"now","arguments":{}}}'curl -X POST http://localhost:9091/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"text_stats","arguments":{"text":"Hello World"}}}'Add to mcp.json:
{
"mcpServers": {
"local-example": {
"url": "http://127.0.0.1:9091/mcp",
"description": "ACFlow MCP Server",
"disabled": false
}
}
}MIT License