Cortex
by FreePeak
Cortex allows applications to provide context for LLMs in a standardized way, separating the concerns of providing context from the actual LLM interaction. It implements the full MCP specification, making it easy to build MCP servers that expose resources and tools.
Last updated: N/A
What is Cortex?
Cortex is a Golang framework for building Model Context Protocol (MCP) servers. It allows applications to expose resources and tools to Large Language Models (LLMs) in a standardized and secure manner, following the MCP specification.
How to use Cortex?
To use Cortex, you need to install the package using go get github.com/FreePeak/cortex
. Then, you can create an MCP server, define tools and resources, and expose them via standard transports like STDIO or HTTP with Server-Sent Events (SSE). The provided Quickstart example demonstrates how to create a simple echo server.
Key features of Cortex
Build MCP servers that expose resources and tools
Use standard transports like stdio and Server-Sent Events (SSE)
Handle all MCP protocol messages and lifecycle events
Follow Go best practices and clean architecture principles
Use cases of Cortex
Providing context to LLMs in command-line tools
Integrating LLMs with web applications using SSE
Creating custom providers for specific data sources or functionalities
Building a plugin system for extending server capabilities
FAQ from Cortex
What is MCP?
What is MCP?
The Model Context Protocol (MCP) is a standardized protocol that allows applications to provide context for LLMs in a secure and efficient manner.
What are Tools in Cortex?
What are Tools in Cortex?
Tools let LLMs take actions through your server. Unlike resources, tools are expected to perform computation and have side effects.
What are Providers in Cortex?
What are Providers in Cortex?
Providers allow you to group related tools and resources into a single package that can be easily registered with a server.
What are Resources in Cortex?
What are Resources in Cortex?
Resources are how you expose data to LLMs. They're similar to GET endpoints in a REST API - they provide data but shouldn't perform significant computation or have side effects.
What transport methods does Cortex support?
What transport methods does Cortex support?
Cortex supports STDIO for command-line tools and direct integrations, and HTTP with SSE for web applications. It also supports running multiple protocol servers simultaneously.