MCP Servers
MCP Servers are containers that group related tools together and expose them via the MCP protocol. Understanding how MCP servers work is essential for organizing your tools and making them available to AI assistants.
What is an MCP Server?
An MCP Server is a container that groups related tools together and exposes them via the Model Context Protocol (MCP). Think of it as a "toolbox" - it holds multiple tools that work together to solve a particular problem or serve a specific purpose.
When an AI assistant (like ChatGPT or Claude) wants to use your tools, it connects to your MCP server. The server then tells the AI what tools are available, and the AI can call those tools whenever needed.
An MCP Server provides several key functions:
Groups related tools together - Tools that work together are organized in the same server. For example, you might have a "Customer Data Tools" server that contains tools for looking up customers, updating customer records, and creating customer notes. This organization makes it easy for AI assistants to understand what tools are available and when to use them.
Exposes tools via the MCP protocol - The server implements the MCP protocol, which is the standardized way AI assistants communicate with tools. This means any MCP-compatible AI assistant can connect to your server and use your tools without any custom integration work.
Handles authentication via API keys - The server requires API keys to authenticate requests. This ensures that only authorized AI assistants can connect to and use your tools. When you configure an AI assistant to use your tools, you provide it with the API key for your MCP server.
Manages tool execution and responses - When an AI assistant calls a tool, the server receives the request, executes the tool code in a secure sandbox, and returns the results. The server handles all the complexity of execution, error handling, and response formatting.
Why Group Tools in Servers?
Grouping related tools together in MCP servers provides several benefits:
Logical organization - Related tools are grouped together, making it easy to understand what functionality is available
Easier discovery - AI assistants can see all related tools at once, making it easier for them to understand what's available and choose the right tool
Simplified management - You can manage related tools together, update them as a group, and control access at the server level
Better performance - Tools in the same server can share resources and context more efficiently
Clearer purpose - Each server has a clear purpose, making it obvious what it does and when to use it
Example: Organizing Tools in Servers
Let's say you're building tools for a customer support team. You might organize them like this:
MCP Server: "Customer Data Tools"
Tool: "Get Customer by Email" - Tool: "Get Customer Order History" - Tool: "Update Customer Status"
- **MCP Server: "Ticket Management Tools"**
Tool: "Create Support Ticket" - Tool: "Update Ticket Status" - Tool: "Get Ticket Details" - Tool: "Assign Ticket to Agent"
This organization makes it clear what each server does and helps AI assistants understand when to use which tools.
Creating MCP Servers
Creating an MCP server is straightforward and is one of the key steps in setting up your tools. Here's a detailed guide:
The Creation Process
Navigate to your workspace - From the workspace view, you'll see a list of MCP servers (which will be empty if this is your first server). The workspace dashboard shows all MCP servers and provides quick access to create new ones.
Click "Create MCP Server" - This button is typically at the top of the MCP servers list or in a prominent location on the workspace dashboard. Clicking it opens a form to create a new server.
Enter server details - You'll need to provide:
**Name** - Give your server a descriptive name that clearly indicates what it does. Examples: "Customer Data Tools", "Weather Services", "Order Management Tools", or "Analytics Tools". Choose a name that will make sense to both you and AI assistants that will use these tools. - **Description** - Write a clear description of what this server does and what kinds of tools it contains. This description helps AI assistants understand when to connect to this server. For example: "Tools for managing customer data including lookups, updates, and order history" or "Weather-related tools for fetching current conditions and forecasts". - **API Key** - You'll need to select or create an API key for this server. API keys authenticate requests to your MCP server. You can either:
Select an existing API key from your workspace if you've already created one - Create a new API key specifically for this server The API key is what you'll provide to AI assistants when configuring them to use your tools. Keep it secure - treat it like a password. You can create multiple API keys for different purposes (e.g., one for development, one for production).
- **Save and start adding tools** - Once you've entered all the details, click "Create" or "Save" to create the server. You'll be taken to the server view where you can start adding tools. ### What Happens After Creation
Once your MCP server is created, it's immediately available, but it won't have any tools yet. You'll be taken to the server view where you can:
See all tools in this server (empty at first)
Create new tools
View server settings and configuration
See connection information for AI assistants
View usage statistics
The server is live and ready to accept connections, but AI assistants won't find any tools until you add them. Your next step is to create tools within this server.
Connection Information
After creating your MCP server, you'll see connection information that you'll need when configuring AI assistants. This typically includes:
Server URL - The endpoint where AI assistants should connect
API Key - The authentication key (shown only once when created, so save it securely)
Connection instructions - Step-by-step guide for connecting different AI assistants
You'll use this information when setting up ChatGPT, Claude, or other AI assistants to use your tools.
Server Configuration and Settings
MCP servers have various configuration options that control how they behave. While you can use default settings initially, understanding these options helps you optimize your servers for your specific needs.
Custom Headers for Requests
You can configure custom headers that are sent with requests to your MCP server. This is useful for:
Adding authentication headers for downstream services
Including custom metadata in requests
Setting up integration with other systems
Custom headers are typically set at the server level and apply to all requests, though you can also override them in individual tools if needed.
Server Metadata
Server metadata includes information about your server that helps AI assistants understand what it does:
Name and description - What we discussed during creation
Version information - Track which version of your server is running
Capabilities - What features your server supports
Contact information - Who to contact about this server (optional)
This metadata is exposed to AI assistants when they connect, helping them understand what your server provides.
Rate Limiting Settings
Rate limiting controls how many requests your server can handle:
Requests per minute - Limit the number of tool calls per minute
Requests per hour - Limit the number of tool calls per hour
Concurrent requests - Limit how many requests can be processed simultaneously
Rate limiting helps protect your server from abuse and ensures fair usage. You can set different limits for different API keys if needed. If a client exceeds the rate limit, requests will be rejected with an appropriate error message.
Execution Timeouts
Execution timeouts control how long a tool is allowed to run before it's automatically terminated:
Default timeout - The default maximum execution time for tools in this server
Maximum timeout - The absolute maximum execution time (cannot be exceeded)
Per-tool overrides - Individual tools can have different timeouts if needed
Timeouts prevent runaway processes and ensure that slow or stuck tools don't consume resources indefinitely. Choose timeouts that give your tools enough time to complete their work but aren't so long that they waste resources.
Other Configuration Options
Depending on your plan and needs, you might also configure:
Logging levels - Control how much detail is logged for debugging
Error handling - Configure how errors are reported and handled
Resource limits - Set limits on memory, CPU, or other resources
Notifications - Configure alerts for errors, rate limit violations, or other events
How MCP Protocol Implementation Works
MCP servers implement the Model Context Protocol, which is the standardized way AI assistants communicate with tools. Understanding how this works helps you build better tools and troubleshoot issues.
JSON-RPC Message Format
The MCP protocol uses JSON-RPC, a standardized format for remote procedure calls. This means:
Structured messages - All communication follows a consistent format
Request/response pattern - AI assistants send requests, servers send responses
Error handling - Errors are returned in a standardized format
Compatibility - Any JSON-RPC compatible client can communicate with your server
You don't need to understand the details of JSON-RPC to use MCP Functions - the platform handles all of this for you. But understanding that it uses a standard protocol helps explain why your tools work with any MCP-compatible AI assistant.
Server-Sent Events (SSE) for Streaming
The MCP protocol uses Server-Sent Events (SSE) for real-time communication:
Persistent connection - AI assistants maintain a persistent connection to your server
Real-time updates - The server can send updates as they happen
Streaming responses - Long-running tools can stream progress updates
Efficient communication - SSE is more efficient than polling for updates
This means that when an AI assistant calls a tool, it can receive updates in real-time as the tool executes, rather than waiting for the entire execution to complete.
Tool Discovery via Protocol Handshake
When an AI assistant first connects to your MCP server, it performs a "handshake" to discover what tools are available:
Connection - The AI assistant establishes a connection to your server
Authentication - The AI assistant provides the API key to authenticate
Initialize request - The AI assistant sends an "initialize" message
Server capabilities - Your server responds with a list of available tools, their descriptions, and their parameters
Ready to use - The AI assistant now knows what tools are available and can call them
This discovery process happens automatically - you don't need to do anything special. The platform generates the tool list from the tools you've created in the server.
Secure Tool Execution
When an AI assistant calls a tool, the execution happens securely:
Sandboxed environment - Each tool executes in an isolated sandbox that can't access other tools or system resources
Resource limits - Tools are limited in memory, CPU, execution time, and network access
Error isolation - If one tool crashes, it doesn't affect other tools or the server
Secure secrets access - Tools can access workspace secrets securely, but secrets are never exposed in logs or error messages
This security is built into the platform - you don't need to implement it yourself. Every tool execution is automatically secured.
Connecting AI Assistants to Your MCP Server
Once you've created an MCP server and added tools, you need to connect AI assistants to it. The exact process depends on which AI assistant you're using, but the general steps are similar.
What You'll Need
To connect an AI assistant to your MCP server, you'll need:
Server URL - The endpoint where your server is accessible (provided by MCP Functions)
API Key - The authentication key for your server (the one you created when setting up the server)
You can find both of these in your MCP server's settings or connection information page.
General Connection Process
While each AI platform has its own interface, the general process is:
Open the AI assistant's settings or configuration
Find the section for "MCP Servers", "Custom Tools", or "Integrations"
Add a new server connection
Enter the server URL and API key
Save the configuration
Test the connection (the AI should be able to list your tools)
Once connected, the AI assistant will discover your tools and can use them whenever needed.
Best Practices for MCP Servers
Group related tools - Keep tools that work together in the same server. If a server has too many unrelated tools, consider splitting it.
Use descriptive names and descriptions - Help AI assistants understand what your server does and when to use it.
Keep servers focused - Each server should have a clear, single purpose. If you find yourself saying "this server does X and Y", consider splitting it.
Secure your API keys - Treat API keys like passwords. Never commit them to code repositories or share them in insecure channels.
Use different servers for different environments - Have separate servers for development, staging, and production.
Monitor usage - Regularly check which tools are being used and how often. This helps you understand usage patterns and optimize your servers.
Set appropriate rate limits - Configure rate limits that protect your server without being too restrictive for legitimate use.
Document your servers - Keep notes on what each server does, which tools it contains, and how to use it. This helps team members understand your setup.
Last updated