Glimx MCP Server Integration
Glimx CLI includes built-in support for the Model Context Protocol (MCP), which allows AI agents to interact with various tools and services through a standardized interface. This document explains how to configure and use MCP servers with Glimx.
What is MCP?
The Model Context Protocol (MCP) is an open protocol that enables AI models to interact with tools and services in a standardized way. It provides a common interface for:
- File system operations
- Git operations
- Web content fetching
- Memory persistence
- Custom tool integrations
Default MCP Servers
Glimx comes with 5 default MCP servers that are auto-enabled:
- Filesystem - Local file system access
- Git - Git repository operations
- Sequential Thinking - Step-by-step problem solving
- Fetch - Web content retrieval
- Memory - Knowledge graph persistence
Filesystem MCP Server
The filesystem MCP server allows Glimx to interact with your local file system.
Configuration
{
"mcp": {
"filesystem": {
"type": "local",
"command": ["npx", "-y", "@modelcontextprotocol/server-filesystem", "~"],
"enabled": true,
"timeout": 5000
}
}
}
Capabilities
- Read files
- Write files
- List directory contents
- Create directories
- Delete files and directories
- Move/rename files
Git MCP Server
The Git MCP server enables Glimx to perform Git operations on your repository.
Configuration
{
"mcp": {
"git": {
"type": "local",
"command": ["uvx", "mcp-server-git", "--repository", "."],
"enabled": true,
"timeout": 5000
}
}
}
Capabilities
- View commit history
- Check repository status
- View diffs
- List branches
- View file contents at specific commits
Sequential Thinking MCP Server
The sequential thinking MCP server helps Glimx break down complex problems into smaller steps.
Configuration
{
"mcp": {
"sequential-thinking": {
"type": "local",
"command": ["uvx", "mcp-server-sequential-thinking"],
"enabled": true,
"timeout": 5000
}
}
}
Capabilities
- Break down complex tasks
- Create step-by-step plans
- Track progress on multi-step tasks
- Provide reasoning for each step
Fetch MCP Server
The fetch MCP server allows Glimx to retrieve content from the web.
Configuration
{
"mcp": {
"fetch": {
"type": "local",
"command": ["uvx", "mcp-server-fetch"],
"enabled": true,
"timeout": 5000
}
}
}
Capabilities
- Fetch web pages
- Retrieve API responses
- Download files
- Parse HTML content
Memory MCP Server
The memory MCP server provides persistent knowledge storage across sessions.
Configuration
{
"mcp": {
"memory": {
"type": "local",
"command": ["npx", "-y", "@modelcontextprotocol/server-memory"],
"enabled": true,
"timeout": 5000
}
}
}
Capabilities
- Store key-value pairs
- Recall previous information
- Maintain context across sessions
- Create knowledge graphs
Custom MCP Servers
You can add your own MCP servers to extend Glimx's capabilities.
Local MCP Servers
To run a local MCP server:
{
"mcp": {
"my-custom-server": {
"type": "local",
"command": ["my-mcp-server", "--port", "3000"],
"environment": {
"API_KEY": "your-api-key"
},
"enabled": true,
"timeout": 10000
}
}
}
Remote MCP Servers
To connect to a remote MCP server:
{
"mcp": {
"remote-server": {
"type": "remote",
"url": "https://mcp.example.com",
"headers": {
"Authorization": "Bearer your-token"
},
"enabled": true,
"timeout": 5000
}
}
}
MCP Server Management
Enabling/Disabling Servers
You can enable or disable MCP servers by setting the enabled property:
{
"mcp": {
"filesystem": {
"enabled": false // Disable filesystem access
},
"git": {
"enabled": true // Enable git operations
}
}
}
Setting Timeouts
Adjust timeouts for MCP servers based on their responsiveness:
{
"mcp": {
"slow-server": {
"type": "local",
"command": ["slow-mcp-server"],
"enabled": true,
"timeout": 30000 // 30 seconds
}
}
}
MCP Server Development
To create your own MCP server, follow the MCP specification.
Example MCP Server
Here's a simple example of an MCP server in Python:
from mcp.server import Server
from mcp.types import Tool, TextContent
server = Server("my-tool-server")
@server.tool()
async def hello_world() -> Tool:
return Tool(
name="hello_world",
description="Say hello to the world",
inputSchema={},
)
@server.call_tool()
async def call_hello_world(name: str) -> list[TextContent]:
return [TextContent(type="text", text=f"Hello, {name}!")]
if __name__ == "__main__":
server.run()
Troubleshooting MCP Servers
Server Not Starting
If an MCP server fails to start:
- Check that the required dependencies are installed
- Verify the command path is correct
- Ensure the server has necessary permissions
Timeout Issues
If an MCP server times out:
- Increase the timeout value in configuration
- Check if the server is responding slowly
- Verify network connectivity for remote servers
Permission Errors
If you encounter permission errors:
- Check file system permissions
- Verify API keys are correctly set
- Ensure the server has necessary access rights
Security Considerations
When using MCP servers, keep these security considerations in mind:
- Local Servers: Only run trusted MCP servers locally
- Remote Servers: Verify the authenticity of remote MCP servers
- Permissions: Use the permission system to control MCP server access
- API Keys: Store API keys securely and limit their scope
Next Steps
- Configuration Guide - Learn how to configure MCP servers
- Free Models Guide - Discover free AI models to use with Glimx
- Permissions System - Understand how to control access to MCP servers