{"id":37213041,"url":"https://github.com/makarski/mcp-robot","last_synced_at":"2026-01-15T00:32:42.673Z","repository":{"id":300840245,"uuid":"1007338747","full_name":"makarski/mcp-robot","owner":"makarski","description":"MCP Server SDK in Golang","archived":false,"fork":false,"pushed_at":"2025-08-27T14:35:36.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-02T23:44:17.414Z","etag":null,"topics":["ai","golang","mcp-server","modelcontextprotocol","server"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/makarski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-23T20:54:31.000Z","updated_at":"2025-08-27T14:37:04.000Z","dependencies_parsed_at":"2025-08-27T16:22:18.741Z","dependency_job_id":null,"html_url":"https://github.com/makarski/mcp-robot","commit_stats":null,"previous_names":["makarski/mcp-robot"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/makarski/mcp-robot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makarski%2Fmcp-robot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makarski%2Fmcp-robot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makarski%2Fmcp-robot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makarski%2Fmcp-robot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/makarski","download_url":"https://codeload.github.com/makarski/mcp-robot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makarski%2Fmcp-robot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28439730,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T22:37:52.437Z","status":"ssl_error","status_checked_at":"2026-01-14T22:37:31.496Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","golang","mcp-server","modelcontextprotocol","server"],"created_at":"2026-01-15T00:32:42.025Z","updated_at":"2026-01-15T00:32:42.660Z","avatar_url":"https://github.com/makarski.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"MCP Robot - Go Server Library for Model Context Protocol\n===\n\nA Go server library for implementing [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) servers, built following Go conventions and inspired by the standard `net/http` package.\n\n\u003e **⚠️ Work in Progress**: This library currently supports **tools only**. Resources, prompts, and other MCP features are planned for future releases.\n\n## 🚀 Features\n\n- **Type-Safe Tool Definitions**: Leverage Go generics for compile-time type safety\n- **Fluent Builder API**: Intuitive schema building with method chaining\n- **Automatic Input Validation**: Input arguments are automatically validated against input schemas\n- **Multiple Server Types**: HTTP and Stdio transport support\n- **Rich Result Types**: Support for text, media, structured data, and resource links\n- **Go Conventions**: Follows standard Go patterns, inspired by `net/http\n\n## 📦 Installation\n\n```bash\ngo get github.com/makarski/mcp-robot\n```\n\n## 🔧 Quick Start\n\n```go\npackage main\n\nimport (\n    \"github.com/makarski/mcp-robot/server\"\n    \"github.com/makarski/mcp-robot/tools\"\n)\n\nfunc main() {\n    // Define a tool with input/output schemas\n    weatherTool := tools.NewTool(\"get_weather\").\n        Title(\"Weather Information\").\n        Description(\"Get current weather for a location\").\n        Input().\n            WithString(\"location\", \"City name or coordinates\", true).\n            WithBoolean(\"celsius\", \"Use celsius temperature\", false).\n            Done().\n        Output().\n            WithString(\"status\", \"Response status\", true).\n            WithNumber(\"temperature\", \"Temperature value\", true).\n            WithString(\"conditions\", \"Weather conditions\", true).\n            Done().\n        MarkReadOnly(true).\n        Build()\n\n    // Create tool function\n    weatherFunc := tools.ToolFunc[tools.ToolResultStructured](func(params map[string]any) (tools.ToolResultStructured, error) {\n        location := params[\"location\"].(string)\n        return tools.ToolResultStructured{\n            \"status\": \"success\",\n            \"temperature\": 22.5,\n            \"conditions\": \"Sunny\",\n            \"location\": location,\n        }, nil\n    })\n\n    // Build and start server\n    server := server.NewServerBuilder(\"weather-server\", \"1.0.0\").\n        WithTool(weatherTool, weatherFunc).\n        BuildHTTPServer()\n\n    server.ListenAndServe(\"mcp\")(\":8080\", nil)\n}\n```\n\n#### Stdio Server\n\n```go\nserver := server.NewServerBuilder(\"weather-server\", \"1.0.0\").\n    WithTool(weatherTool, weatherFunc).\n    BuildStdioServer()\n\n// Start server\nserver.ListenAndServe()\n```\n\n## 🏗️ Tool Definition Builder\n\n_The library provides validation for both input and output schemas_\n\n### Basic Types\n\n```go\ntool := tools.NewTool(\"example\").\n    Input().\n        WithString(\"name\", \"User name\", true).           // required\n        WithNumber(\"age\", \"User age\", false).            // optional\n        WithBoolean(\"active\", \"Is active\", true).\n        Done().\n    Build()\n```\n\n### Arrays\n\n```go\ntool := tools.NewTool(\"process_data\").\n    Input().\n        WithArray(\"items\", \"List of items to process\", true).\n            Of(\"object\", \"Individual item\").\n                WithString(\"id\", \"Item ID\", true).\n                WithString(\"name\", \"Item name\", true).\n                Done().\n        Done().\n    Build()\n```\n\n### Nested Objects\n\nArrays\n\n```go\ntool := tools.NewTool(\"process_data\").\n    Input().\n        WithArray(\"items\", \"List of items to process\", true).\n            Of(\"object\", \"Individual item\").\n                WithString(\"id\", \"Item ID\", true).\n                WithString(\"name\", \"Item name\", true).\n                Done().\n        Done().\n    Build()\n```\n\n## 🎯 Tool Result Types\n\n### Text Results\n\n```go\nfunc textTool(params map[string]any) (tools.ToolResultText, error) {\n    return tools.NewToolResultText(\"Hello, World!\"), nil\n}\n```\n\n### Structured Results\n\n```go\nfunc structuredTool(params map[string]any) (tools.ToolResultStructured, error) {\n    return tools.ToolResultStructured{\n        \"status\": \"success\",\n        \"data\": map[string]any{\n            \"count\": 42,\n            \"items\": []string{\"item1\", \"item2\"},\n        },\n    }, nil\n}\n```\n\n### Rich Media Results\n\n```go\nfunc mediaTool(params map[string]any) (tools.ToolResultUnion, error) {\n    imageData, _ := os.ReadFile(\"chart.png\")\n\n    return *tools.NewToolResultUnion().\n        AddText(\"Analysis complete\").\n        AddImage(imageData, \"image/png\").\n        AddResourceLink(\"https://example.com/report\", \"Full Report\", \"Detailed analysis\", \"text/html\"), nil\n}\n```\n\n## 🔧 Tool Annotations\n\n```go\ntool := tools.NewTool(\"database_query\").\n    Description(\"Query database\").\n    MarkReadOnly(true).              // Doesn't modify data\n    MarkAsIdempotent(true).          // Safe to retry\n    MarkAsCallingOpenWorld(false).   // Closed system\n    Build()\n```\n\n## 📝 Error Handling\n\nThe library provides structured error handling with MCP protocol errors:\n\n```go\nfunc toolWithValidation(params map[string]any) (tools.ToolResultText, error) {\n    email, ok := params[\"email\"].(string)\n    if !ok {\n        return tools.ToolResultText{}, spec.NewProtocolError(\n            spec.ErrorCodeInvalidParams,\n            \"email parameter is required and must be a string\",\n        )\n    }\n\n    // Tool logic...\n    return tools.NewToolResultText(\"Success\"), nil\n}\n```\n\n## 🚀 What's Next\n\n- **Resources**: File and data resource management\n- **Prompts**: Dynamic prompt templates\n- **Enhanced Validation**: Full JSON Schema support for arrays and nested objects\n- **Progress Reporting**: Long-running operation support\n- **Streaming**: Real-time data streaming\n\n---\n\n**Built with Go conventions in mind** • Inspired by `net/http` • Type-safe • Protocol compliant\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakarski%2Fmcp-robot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmakarski%2Fmcp-robot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakarski%2Fmcp-robot/lists"}