gram
Context layer for your product. Connect your agents and chat to 1st and 3rd party MCP servers!
claude mcp add --transport stdio speakeasy-api-gram node path/to/server.js \ --env GRAM_HOST="Host for the MCP server (default 0.0.0.0)" \ --env GRAM_PORT="Port for the MCP server (default 3000)"
How to use
Gram is an MCP server platform that makes it easy to host Model Context Protocol tools built from TypeScript or OpenAPI definitions. It supports hosting tools defined as Gram Functions (TypeScript-based) or OpenAPI documents, enabling you to expose them as hosted MCP servers that can be consumed by LLMs and agents. With Gram, you can create toolsets, chain tools into higher-order constructs, and secure access via built-in OAuth flows. The workflow typically involves authoring Gram Functions locally, building and deploying them to an MCP server, and then interacting with those tools through standard MCP tooling or your own application.
Once running, Gram exposes your defined tools via a server instance that can be queried by MCP clients. You can start by generating a Gram Function project with the Gram Functions framework, implement your tool logic, and then run a local MCP server to test the tool in isolation. For more complex scenarios, you can compose multiple tools into toolsets, host them under a custom domain, and manage access with Gram’s authentication options. The Gram CLI provides commands to authenticate, push sources (OpenAPI or Gram Functions) to your MCP servers, and manage deployments from the command line.
How to install
Prerequisites:
- Node.js (LTS version) installed on your machine
- Git installed
- Optional: pnpm if you plan to use the Gram Functions workflow
Step-by-step installation:
-
Install Node.js from https://nodejs.org/
-
Clone the Gram MCP repository or create your project directory:
git clone https://github.com/speakeasy-api/gram.git cd gram
-
Install dependencies:
npm install
-
Build the project (if applicable) and prepare to run the MCP server. If the project uses a TypeScript setup, compile to JavaScript and ensure the server entry point (e.g., server.js or dist/server.js) exists:
npm run build
-
Run the MCP server locally (adjust the path to your server entry accordingly):
node path/to/server.js
-
Alternatively, if you’re using the Gram Functions workflow, install the Gram CLI and create a function project as described in the Gram documentation, then build and deploy according to the guides.
Note: If you prefer using Docker for hosting, you can containerize the server once you have a runnable entry point. See the additional notes for more details.
Additional notes
Tips and considerations:
- Check environment variables such as GRAM_PORT and GRAM_HOST to configure where the MCP server listens.
- If you upgrade Gram or its dependencies, re-run npm install to ensure all packages are up to date.
- When developing locally, enable MCP inspector (if supported by your setup) to introspect tool inputs/outputs during testing.
- For OpenAPI-based tools, ensure your OpenAPI document is valid OpenAPI 3.0.x or 3.1.x and registered with the Gram server according to the docs.
- If you encounter port conflicts, change GRAM_PORT to an unused port and restart the server.
- Review the Gram CLI docs to learn how to authenticate, push sources, and manage deployments programmatically.
Related MCP Servers
context-space
Ultimate Context Engineering Infrastructure, starting from MCPs and Integrations
laravel-restify
Laravel API for Ai Agents and humans.
mesh
One secure endpoint for every MCP server. Deploy anywhere.
MCP-Checklists
MCP server from MCP-Manager/MCP-Checklists
agent
MCPAgent for Grupa.AI Multi-agent Collaboration Network (MACNET) with Model Context Protocol (MCP) capabilities baked in
ia-na-pratica
IA na Prática: LLM, RAG, MCP, Agents, Function Calling, Multimodal, TTS/STT e mais