cortex
A declarative platform for building Model Context Protocol (MCP) servers in Golang—exposing tools, resources & prompts in a clean, structured way
claude mcp add --transport stdio freepeak-cortex docker run -i ghcr.io/FreePeak/cortex:latest
How to use
Cortex is an MCP (Model Context Protocol) server framework written in Go that lets you declaratively expose Resources, Tools, and Prompts for large language models. It implements the MCP specification, enabling communication over standard transports like STDIO and HTTP/SSE. With Cortex, you can model your data and capabilities as reusable components called Providers, Tools, and Resources, then compose them into a runnable MCP server. This makes it easier for LLMs to discover and invoke capabilities in a consistent, protocol-compliant way. The Quickstart in the README demonstrates how to create a simple Echo Tool and expose it via an MCP server, which is a good template for building more complex servers with multiple tools and providers.
How to install
Prerequisites:
- Docker (for the provided container option) or a Go toolchain if you choose to build from source
- Git to clone repositories if you’re starting from source
Option A: Run via Docker image
- Install Docker on your system
- Run Cortex container (example): docker run -i ghcr.io/FreePeak/cortex:latest
Option B: Build from source (Go)
- Ensure Go is installed (https://golang.org/dl/)
- Clone the repository: git clone https://github.com/FreePeak/cortex.git
- Change to the repository directory: cd cortex
- Build the binary: go build ./...
- Run the server (example): ./cortex
Notes:
- The README provides a quickstart that shows how to instantiate an MCP server in Go and register tools and providers. You can adapt that pattern to compile a standalone server binary and run it in your environment.
Additional notes
Tips and common issues:
- Cortex follows the MCP protocol; ensure stdout is reserved for MCP JSON-RPC messages when running in STDIO mode.
- If embedding Cortex into another application, use the provided server and tool APIs to register Tools and Providers.
- When using Docker, you may want to map configuration or credentials as environment variables if you integrate with external services.
- Review the MCP concepts: Resources provide read-only data, Tools perform actions, and Prompts define interaction templates. Networking and transport options include STDIO and HTTP/SSE.
- If you encounter protocol mismatches, verify you’re using a compatible MCP version as Cortex aligns with the latest MCP spec.
Related MCP Servers
mcp-language
mcp-language-server gives MCP enabled clients access semantic tools like get definition, references, rename, and diagnostics.
lingti-bot
🐕⚡ 「极简至上 效率为王 一次编译 到处执行 极速接入」的 AI Bot
kodit
👩💻 MCP server to index external repositories
github-brain
An experimental GitHub MCP server with local database.
awesome -best-practices
Build Awesome MCPs with Awesome Best Practices for MCP Servers and MCP Clients
create -app
A CLI tool for quickly scaffolding Model Context Protocol (MCP) server applications with TypeScript support and modern development tooling