MCP Integration
Connect to external servers via the Model Context Protocol for databases, APIs, file systems, and more. Configure GitHub, PostgreSQL, Slack, filesystem, and custom MCP servers.
XibeCode supports the Model Context Protocol (MCP), an open protocol that standardizes how applications provide context to LLMs. Connect to external servers for databases, APIs, file systems, and more.
What is MCP?
MCP enables:
- Extended Tools — Add tools from external servers (databases, APIs, etc.)
- Access Resources — Read data from external sources
- Prompt Templates — Use pre-built prompts from servers
- Context Sharing — Share context between different AI tools
Quick Start
# Initialize MCP configuration
xibecode mcp init
# Add a server
xibecode mcp add
# List configured servers
xibecode mcp list
# Reload after editing
xibecode mcp reloadAdding MCP Servers
File-Based Configuration (Recommended)
# Show the config file path
xibecode mcp file
# Open in your default editor
xibecode mcp editConfiguration Format
{
"mcpServers": {
"filesystem": {
"command": "mcp-server-filesystem",
"args": ["--root", "/path/to/files"]
},
"github": {
"command": "mcp-server-github",
"env": {
"GITHUB_TOKEN": "your_token_here"
}
},
"postgres": {
"command": "mcp-server-postgres",
"env": {
"DATABASE_URL": "postgresql://user:pass@localhost/db"
}
}
}
}MCP Commands
xibecode mcp init # Initialize default config
xibecode mcp add # Add a server
xibecode mcp edit # Edit configuration
xibecode mcp list # List configured servers
xibecode mcp remove # Remove a server
xibecode mcp reload # Reload after editing
xibecode mcp file # Show file path
xibecode mcp status # Check connection statusUsing MCP Tools
Once configured, MCP tools are automatically available. Tools are prefixed with the server name:
filesystem::read_file
github::create_issue
github::list_repos
postgres::query
slack::send_messageIn chat mode, view MCP tools:
xibecode chat
> /mcp # Show MCP status and tools
> /mcp list # List all MCP tools
> /mcp reload # Reload MCP serversServer Configuration Options
| Option | Description | Required |
|---|---|---|
command | The command to start the MCP server | Yes |
args | Array of command-line arguments | No |
env | Environment variables for the server | No |
cwd | Working directory for the server | No |
Example Configurations
GitHub MCP Server
npm install -g @modelcontextprotocol/server-github{
"mcpServers": {
"github": {
"command": "mcp-server-github",
"env": {
"GITHUB_TOKEN": "ghp_your_token_here"
}
}
}
}xibecode chat
> Create an issue about the login bug in the main repoPostgreSQL MCP Server
npm install -g @modelcontextprotocol/server-postgres{
"mcpServers": {
"postgres": {
"command": "mcp-server-postgres",
"env": {
"DATABASE_URL": "postgresql://user:pass@localhost:5432/mydb"
}
}
}
}Filesystem MCP Server
npm install -g @modelcontextprotocol/server-filesystem{
"mcpServers": {
"docs": {
"command": "mcp-server-filesystem",
"args": ["--root", "/path/to/documentation"]
}
}
}Slack MCP Server
{
"mcpServers": {
"slack": {
"command": "mcp-server-slack",
"env": {
"SLACK_BOT_TOKEN": "xoxb-your-token",
"SLACK_TEAM_ID": "T01234567"
}
}
}
}Popular MCP Servers
| Server | Description | Package |
|---|---|---|
| Filesystem | File system access | @modelcontextprotocol/server-filesystem |
| GitHub | GitHub API integration | @modelcontextprotocol/server-github |
| PostgreSQL | PostgreSQL database | @modelcontextprotocol/server-postgres |
| Slack | Slack messaging | @modelcontextprotocol/server-slack |
| Google Drive | Google Drive access | @modelcontextprotocol/server-gdrive |
| SQLite | SQLite database | @modelcontextprotocol/server-sqlite |
| Puppeteer | Browser automation | @modelcontextprotocol/server-puppeteer |
Transport Types
XibeCode supports stdio transport — MCP servers run as local subprocesses. The server communicates via standard input/output streams using JSON-RPC messages.
Debugging MCP Connections
# Check server status
xibecode mcp status
# View server logs (verbose mode)
xibecode chat --verbose
> /mcp
# Test a specific tool
xibecode chat
> Use the github::list_repos tool to list my repositoriesSecurity Considerations
- Store sensitive tokens in environment variables, not in config files
- Use read-only database credentials when possible
- Limit filesystem access to specific directories
- Review MCP server permissions before installation
Building Custom MCP Servers
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
const server = new Server(
{
name: "my-custom-server",
version: "1.0.0",
},
{
capabilities: { tools: {} },
},
);
server.setRequestHandler(ListToolsRequestSchema, async () => ({
tools: [
{
name: "my_custom_tool",
description: "Does something custom",
inputSchema: {
type: "object",
properties: {
input: { type: "string" },
},
},
},
],
}));
const transport = new StdioServerTransport();
await server.connect(transport);Next Steps
- Plugins — Create simpler tool extensions
- Examples — See MCP in action
- Configuration — Configure XibeCode
AI Test Generation
Automatically generate comprehensive test suites for your code using AI-powered analysis. Supports Vitest, Jest, Mocha, pytest, and Go test.
Plugin System
Extend XibeCode with custom tools and domain-specific logic. Create JavaScript or TypeScript plugins with registerTools, initialize, and cleanup hooks.