MCP Server Configuration¶
AI Code UI supports Model Context Protocol (MCP) servers for extended AI assistant capabilities. This guide covers MCP server detection, configuration, and management.
What are MCP Servers?¶
MCP (Model Context Protocol) servers extend AI assistants with additional tools and capabilities. They allow AI models to:
- Access external services and APIs
- Execute specialized commands
- Interact with development tools
- Manage tasks and workflows
Supported MCP Operations¶
Claude CLI Integration¶
AI Code UI can interact with MCP servers through the Claude CLI:
# List configured MCP servers
GET /api/mcp/cli/list
# Add a new MCP server
POST /api/mcp/cli/add
# Remove an MCP server
DELETE /api/mcp/cli/remove/:serverName
Direct Configuration¶
MCP servers are configured in Claude's settings files:
~/.claude.json(user-level)~/.claude/settings.json(alternative location)
Configuration Format¶
Basic Structure¶
{
"mcpServers": {
"server-name": {
"command": "command-to-run",
"args": ["arg1", "arg2"],
"env": {
"ENV_VAR": "value"
}
}
}
}
Example: TaskMaster MCP Server¶
{
"mcpServers": {
"task-master-ai": {
"command": "npx",
"args": ["-y", "--package=task-master-ai", "task-master-ai"],
"env": {}
}
}
}
Example: Multiple Servers¶
{
"mcpServers": {
"task-master-ai": {
"command": "npx",
"args": ["-y", "--package=task-master-ai", "task-master-ai"]
},
"filesystem": {
"command": "npx",
"args": ["-y", "@anthropic/mcp-server-filesystem", "/path/to/allowed/dir"]
},
"github": {
"command": "npx",
"args": ["-y", "@anthropic/mcp-server-github"],
"env": {
"GITHUB_TOKEN": "ghp_xxxxxxxxxxxx"
}
}
}
}
TaskMaster MCP Server¶
Installation¶
The TaskMaster MCP server is typically used via npx (no installation needed):
{
"mcpServers": {
"task-master-ai": {
"command": "npx",
"args": ["-y", "--package=task-master-ai", "task-master-ai"]
}
}
}
Or with global installation:
Detection¶
AI Code UI automatically detects TaskMaster MCP server configuration:
Response:
{
"success": true,
"installation": {
"isInstalled": true,
"installPath": "/usr/local/bin/task-master",
"version": "1.0.0"
},
"mcpServer": {
"hasMCPServer": true,
"isConfigured": true,
"configPath": "~/.claude.json"
},
"isReady": true
}
Capabilities¶
When configured, TaskMaster MCP provides these tools to AI assistants:
get_tasks- List all tasksget_task- Get task detailsadd_task- Create new taskupdate_task- Modify taskset_status- Update task statusnext_task- Get recommended next taskparse_prd- Generate tasks from PRD
API Endpoints¶
List MCP Servers (via Claude CLI)¶
Response:
{
"success": true,
"servers": [
{
"name": "task-master-ai",
"command": "npx",
"args": ["-y", "--package=task-master-ai", "task-master-ai"]
}
]
}
Add MCP Server¶
POST /api/mcp/cli/add
Content-Type: application/json
{
"name": "my-server",
"command": "npx",
"args": ["-y", "my-mcp-package"]
}
Remove MCP Server¶
Get Server Configuration¶
Returns raw MCP server configurations from Claude settings.
Detection Logic¶
AI Code UI checks for MCP configuration in this order:
~/.claude.json- Primary configuration file~/.claude/settings.json- Alternative location
The detection utility (server/utils/mcp-detector.js) checks:
- Configuration file exists
mcpServerskey is present- Target server (e.g.,
task-master-ai) is configured - Server configuration is valid
Common MCP Servers¶
| Server | Package | Description |
|---|---|---|
| TaskMaster | task-master-ai |
AI-powered task management |
| Filesystem | @anthropic/mcp-server-filesystem |
File system access |
| GitHub | @anthropic/mcp-server-github |
GitHub API integration |
| Postgres | @anthropic/mcp-server-postgres |
PostgreSQL database access |
Security Considerations¶
Environment Variables¶
Sensitive values like API keys should use environment variables:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@anthropic/mcp-server-github"],
"env": {
"GITHUB_TOKEN": "${GITHUB_TOKEN}"
}
}
}
}
Path Restrictions¶
For filesystem servers, always specify allowed directories:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@anthropic/mcp-server-filesystem",
"/home/user/projects",
"/home/user/documents"
]
}
}
}
Command Validation¶
AI Code UI validates MCP server commands before execution to prevent command injection.
Troubleshooting¶
Server Not Detected¶
-
Check configuration file location:
-
Verify JSON syntax:
-
Check server name matches exactly:
- Configuration uses
task-master-ai - Detection looks for
task-master-ai(exact match)
Server Fails to Start¶
-
Verify command is available:
-
Check for package issues:
-
Review Claude CLI logs for detailed errors
Permission Errors¶
-
Check file permissions:
-
Verify npm global directory permissions
Configuration Not Updating¶
-
Restart Claude CLI:
-
Check for syntax errors in configuration
See Also¶
- TaskMaster Integration - TaskMaster features and usage
- Configuration - Environment configuration
- API Reference - Full API documentation