The easiest way to host MCP servers
If you offer an API, you’ve probably been focused on making it as good as possible for humans. Now you also need to make it easy to use for AI agents.
At Speakeasy, we’ve generated over 50 production-ready MCP servers for our customers, and we’ve seen first-hand the complexity of creating, deploying, and hosting an MCP server for your API. We built Gram as a solution to this. Gram is a platform that lets you create, curate, and host MCP servers for your API.
A quick recap of MCP servers and how people use them
Section titled “A quick recap of MCP servers and how people use them”Agents mainly interact with APIs through the Model Context Protocol (MCP). Since it was announced by Anthropic in November 2024, MCP has seen an unprecedented rate of adoption, quickly becoming the de facto standard. Companies like Microsoft, Google, OpenAI, and Cloudflare (among many others) have embraced it and offer MCP servers as a new way to interact with their existing APIs.
But creating, deploying, hosting, and managing MCP servers remains confusing and challenging. Although MCP follows a familiar client-server model, it creates confusion about who should build, own, manage, and maintain the server. With APIs, it’s always been clear. The producer (like Stripe) hosts the API, and the consumer (for example, an online shop) uses that API. With MCP, hosting models vary: Developers often “host” MCP servers on their own machines, or companies host them internally for team-wide access to third-party integrations.
We think that companies will naturally gravitate to hosting and managing their own MCP servers, and we built Gram to make that easy.
Local, remote, or managed: Comparing models for interacting with MCP
Section titled “Local, remote, or managed: Comparing models for interacting with MCP”People use MCP in various ways, broadly categorized as follows:
- Local: A developer downloads an MCP server to their developer machine, and configures an MCP client, like Claude or Cursor, to use the tools provided in that server.
- Remote: A system administrator downloads an MCP server to a company-accessible server. Anyone at the company can configure their MCP client to interact with a company-accessible tool via this server.
- Managed: The API producer hosts and manages the MCP server, allowing any of its customers to configure their MCP clients to connect to the server and use the API.
Currently (unintuitively), MCP servers are usually local, meaning they are hosted or managed on the API consumer side. If you’re a developer and you want to interact with your payments platform or project management application through an MCP client, you first download the MCP server, run it locally, and hook it up to your MCP client (for example, Claude or Cursor). You can then chat with your API, saying things like, “Show me all my tasks due tomorrow” or “Please send reminders to everyone with invoices due this week.” This is often the lowest-friction way to play with MCP, but it comes with many downsides, like replicated work (everyone at the company needs to run the same local Docker container or similar) and lack of control (there’s no centralized place to monitor and control MCP-related requests).
We think the world will move quickly through Remote MCP servers (everyone at a company sharing one hosted server, but with the API consumer still installing and managing this) and end up on Managed MCP servers, where the API Producer is responsible for not only hosting and managing the MCP server, but also for enterprise security features like access control, audit logs, and billing.
Introducing Gram: A platform to create, curate, and distribute tools for AI
Section titled “Introducing Gram: A platform to create, curate, and distribute tools for AI”We built Gram anticipating this world.
Specifically, Gram lets you:
- Upload the OpenAPI Document for your API and generate a full MCP server.
- Curate and customize the dozens or even hundreds of generated tools into Toolsets, which are bundles of tools that are likely to be useful to an agent.
- Instantly host the MCP server so that your customers can connect their MCP clients to it.
We’ll explain this in more detail below, but if you’re a “show don’t tell” person, head over to getgram.ai and try it out.
Still here? Let’s look at some of what Gram offers:
- Instant access: Users can connect to your MCP server without any local setup, removing friction and allowing tools like Claude or Cursor to work out of the box.
- Distribution: You can share your MCP server internally or externally without needing others to run it locally, speeding up onboarding and enabling broader adoption.
- Monetization potential: Hosting allows you to turn your MCP logic into a product, offering it as a paid integration or service – especially if it exposes valuable tools or APIs.
- Reliability and uptime: Unlike a local setup that stops when your machine sleeps, a hosted server can stay online 24/7. You have a stable endpoint for your MCP server, ensuring consistent availability for users or agents.
- Accessibility and team collaboration: A hosted MCP server can be shared across teams or departments, making it easier to centralize tools and support cross-functional collaboration.
- Scalability: Like any production system, a hosted MCP server can be monitored, scaled, and secured, allowing you to handle growing traffic and multiple concurrent users.
- Scoping: Maybe your customers want their marketing, sales, and product teams to have access to different tools. Maybe some teams should only have read access to some resources. You can easily create different toolsets customized to specific use cases.
Creating and hosting an MCP server in three simple steps
Section titled “Creating and hosting an MCP server in three simple steps”Gram takes your OpenAPI document and, in just three steps, generates a fully functional, scoped MCP server, ready to use across environments, teams, and agents.
Expose your MCP server as an internal or public service without managing infrastructure, while Gram handles hosting, distribution, and security.
Let’s see how easy it is to create an MCP server with Gram.
Create an MCP server
Section titled “Create an MCP server”First, upload an OpenAPI document.
Next, create a toolset.
A toolset is a curated bundle of tools for a specific use case or team. In the Gram interface, you can select which tools to include and which to ignore based on your needs.
Set environment variables.
Click Environments in the sidebar, and then + New Environment.
Now you can interact with your MCP server in real time in the Gram Playground.
Public and authenticated servers
Section titled “Public and authenticated servers”To configure your MCP server as public or authenticated, go to MCP in the sidebar and select MCP Config for your hosted server.
- A public server can be instantly used by any of your customers, simply by copying the configuration provided into an MCP client.
- An authenticated server requires a Gram API key in the project configuration, making it suitable for internal use cases where access needs to be restricted to authorized users.
Connect your MCP server to AI agents
Section titled “Connect your MCP server to AI agents”In addition to MCP Clients like Claude, your customers can automate interactions with your MCP server using AI agents. The Gram Python and TypeScript SDKs support OpenAI Agents, LangChain, and other function-based tooling, and Gram provides sample code to help you create agents within your existing framework.
Here is an example Python snippet that shows how to integrate your MCP server with LangChain:
import asyncioimport osfrom langchain import hubfrom langchain_openai import ChatOpenAIfrom langchain.agents import AgentExecutor, create_openai_functions_agentfrom gram_ai.langchain import GramLangchain
key = "<GRAM_API_KEY>"
gram = GramLangchain(api_key=key)
llm = ChatOpenAI( model="gpt-4", temperature=0, openai_api_key=os.getenv("OPENAI_API_KEY"))
tools = gram.tools( project="default", toolset="marketing", environment="demo-environment",)
prompt = hub.pull("hwchase17/openai-functions-agent")
agent = create_openai_functions_agent(llm=llm, tools=tools, prompt=prompt)
agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=False)
async def main(): response = await agent_executor.ainvoke({ "input": "Can you tell me about my tools?" }) print(response)
if __name__ == "__main__": asyncio.run(main())
In the Agents tab in the Playground dashboard, you can build agentic workflows by selecting a language and integration type.
Simplify MCP server hosting
Section titled “Simplify MCP server hosting”Gram generates hosted MCP servers directly from OpenAPI documents, taking care of hosting, testing, distribution, and team-scoped toolsets so you don’t need to manage infrastructure, scaling, or versioning.
Gram also offers:
- API key management
- Custom domains for distribution
- Integrations with popular platforms like Slack and GitHub
Try Gram now and see how easy it is to host and share your MCP server.