Skip to main content

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:

  1. Filesystem - Local file system access
  2. Git - Git repository operations
  3. Sequential Thinking - Step-by-step problem solving
  4. Fetch - Web content retrieval
  5. 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:

  1. Check that the required dependencies are installed
  2. Verify the command path is correct
  3. Ensure the server has necessary permissions

Timeout Issues​

If an MCP server times out:

  1. Increase the timeout value in configuration
  2. Check if the server is responding slowly
  3. Verify network connectivity for remote servers

Permission Errors​

If you encounter permission errors:

  1. Check file system permissions
  2. Verify API keys are correctly set
  3. Ensure the server has necessary access rights

Security Considerations​

When using MCP servers, keep these security considerations in mind:

  1. Local Servers: Only run trusted MCP servers locally
  2. Remote Servers: Verify the authenticity of remote MCP servers
  3. Permissions: Use the permission system to control MCP server access
  4. API Keys: Store API keys securely and limit their scope

Next Steps​