TalkCody

MCP Servers

Extend TalkCody with Model Context Protocol integrations

MCP Servers

Model Context Protocol (MCP) servers extend TalkCody's capabilities by adding custom tools, data sources, and integrations. Connect to external services and give your AI agents powerful new abilities.

What is MCP?

Model Context Protocol (MCP) is an open standard for connecting AI applications to external tools and data sources. It allows:

  • Custom Tools: Add new capabilities beyond built-in tools
  • External Data: Connect to databases, APIs, and services
  • Specialized Functions: Integrate domain-specific functionality
  • Third-Party Services: Use existing MCP servers from the community

MCP is developed by Anthropic and is supported by many AI tools and services. Learn more at modelcontextprotocol.io

How MCP Works

┌─────────────┐
│  TalkCody   │
│  (Client)   │
└──────┬──────┘
       │ MCP Protocol
       ├─────────────────┐
       │                 │
┌──────▼──────┐   ┌──────▼──────┐
│ MCP Server  │   │ MCP Server  │
│  (GitHub)   │   │ (Database)  │
└─────────────┘   └─────────────┘
  1. TalkCody acts as an MCP client
  2. MCP Servers provide tools and resources
  3. AI Agents can use tools from connected servers
  4. Communication happens via standard MCP protocol

MCP Server Types

1. Stdio Servers

Run as local processes, communicate via stdin/stdout:

{
  "name": "filesystem",
  "type": "stdio",
  "command": "npx",
  "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/files"]
}

Use for: Local tools, file access, system integration

2. SSE Servers

Server-Sent Events for real-time communication:

{
  "name": "notifications",
  "type": "sse",
  "url": "http://localhost:3000/sse"
}

Use for: Real-time updates, streaming data, webhooks

3. HTTP Servers

Standard HTTP-based MCP servers:

{
  "name": "api-service",
  "type": "http",
  "url": "https://api.example.com/mcp",
  "headers": {
    "Authorization": "Bearer YOUR_TOKEN"
  }
}

Use for: Cloud services, remote APIs, hosted tools

Installing MCP Servers

  1. Open TalkCody
  2. Click on the MCP Servers tab in the sidebar
  3. Click + Add Server

Configure Server Details

Basic Information:

  • Name: Identifier for the server (e.g., "GitHub", "Postgres")
  • Type: stdio, sse, or http
  • Description: Optional notes about the server's purpose

Connection Settings:

  • For stdio: Command and arguments
  • For sse: Server URL
  • For http: URL and optional headers

Test Connection

  1. Click Test Connection
  2. Verify the server responds correctly
  3. Check that tools are discovered

Enable for Agents

  1. Save the MCP server configuration
  2. Navigate to Agents view
  3. Edit an agent
  4. Enable MCP tools for that agent

Official MCP Servers

Filesystem Server

npx -y @modelcontextprotocol/server-filesystem /path/to/directory
  • Read and write files
  • List directories
  • File search capabilities

GitHub Server

npx -y @modelcontextprotocol/server-github
  • Create issues and PRs
  • Search repositories
  • Manage branches
  • Access repository contents

PostgreSQL Server

npx -y @modelcontextprotocol/server-postgres postgresql://localhost/dbname
  • Execute SQL queries
  • Read database schema
  • Manage tables

Brave Search Server

npx -y @modelcontextprotocol/server-brave-search
  • Web search
  • News search
  • Image search

Community MCP Servers

Google Drive

  • Access files and folders
  • Upload and download
  • Share files

Slack

  • Send messages
  • Read channels
  • Post to workflows

Jira

  • Create and update tickets
  • Search issues
  • Manage sprints

AWS

  • Manage EC2 instances
  • S3 bucket operations
  • Lambda functions

Check the MCP Server Directory for more community servers.

Configuration Examples

Example 1: Local Filesystem Access

Grant AI access to a specific directory:

{
  "name": "project-files",
  "type": "stdio",
  "command": "npx",
  "args": [
    "-y",
    "@modelcontextprotocol/server-filesystem",
    "/Users/username/projects/myproject"
  ],
  "env": {}
}

What it enables:

  • AI can read files in the project
  • Create new files
  • Edit existing files
  • Search through files

Example 2: GitHub Integration

Connect to your GitHub repositories:

{
  "name": "github",
  "type": "stdio",
  "command": "npx",
  "args": ["-y", "@modelcontextprotocol/server-github"],
  "env": {
    "GITHUB_TOKEN": "ghp_your_token_here"
  }
}

What it enables:

  • Create issues from bug reports
  • Generate pull requests
  • Search repositories
  • Read and analyze code from GitHub

Security: Store sensitive tokens in environment variables, not directly in configuration files.

Example 3: Database Access

Connect to a PostgreSQL database:

{
  "name": "app-database",
  "type": "stdio",
  "command": "npx",
  "args": [
    "-y",
    "@modelcontextprotocol/server-postgres",
    "postgresql://user:password@localhost:5432/dbname"
  ]
}

What it enables:

  • Execute SELECT queries
  • Analyze database schema
  • Generate migration scripts
  • Debug data issues

Add web search capabilities:

{
  "name": "web-search",
  "type": "stdio",
  "command": "npx",
  "args": ["-y", "@modelcontextprotocol/server-brave-search"],
  "env": {
    "BRAVE_API_KEY": "your_brave_api_key"
  }
}

What it enables:

  • Search for documentation
  • Find code examples
  • Look up error messages
  • Research best practices

Using MCP Tools in Conversations

Once an MCP server is configured, AI agents can use its tools:

Example: GitHub Issue Creation

User: Create a GitHub issue for the login bug we just discussed

AI: I'll create an issue in your repository.
[Uses GitHub MCP server]
[Creates issue with title and description]

Created issue #123: "Fix login authentication timeout"
Link: https://github.com/user/repo/issues/123

Example: Database Query

User: Show me users who signed up in the last week

AI: I'll query the database for recent users.
[Uses PostgreSQL MCP server]
[Executes: SELECT * FROM users WHERE created_at > NOW() - INTERVAL '7 days']

Found 47 users who signed up in the last 7 days:
- user1@example.com (2024-10-20)
- user2@example.com (2024-10-21)
...

Example: File Operations

User: Create a new React component called UserProfile

AI: I'll create the component file.
[Uses Filesystem MCP server]
[Creates src/components/UserProfile.tsx]

Created UserProfile.tsx with TypeScript and props interface.

Creating Custom MCP Servers

You can build your own MCP servers for custom integrations.

Basic Server Structure

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: {},
    },
  }
);

// Define tools
server.setRequestHandler('tools/list', async () => {
  return {
    tools: [
      {
        name: 'my_tool',
        description: 'Description of what this tool does',
        inputSchema: {
          type: 'object',
          properties: {
            param1: { type: 'string' },
          },
          required: ['param1'],
        },
      },
    ],
  };
});

// Handle tool calls
server.setRequestHandler('tools/call', async (request) => {
  const { name, arguments: args } = request.params;

  if (name === 'my_tool') {
    // Implement tool logic
    return {
      content: [{ type: 'text', text: 'Result from my_tool' }],
    };
  }
});

// Start server
const transport = new StdioServerTransport();
await server.connect(transport);

Publishing Your Server

  1. Test locally with TalkCody
  2. Package as npm module
  3. Publish to npm
  4. Share with the community

See the MCP SDK documentation for detailed guides on creating servers.

Managing MCP Servers

Viewing Connected Servers

  1. Navigate to MCP Servers view
  2. See list of all configured servers
  3. Check connection status
  4. View available tools

Editing Server Configuration

  1. Select a server from the list
  2. Click Edit
  3. Modify settings
  4. Test connection
  5. Save changes

Enabling/Disabling Servers

Toggle servers on/off without deleting:

  • Disabled servers don't provide tools
  • Quick way to temporarily disable integrations
  • No need to reconfigure when re-enabling

Removing Servers

  1. Select server to remove
  2. Click Delete
  3. Confirm deletion
  4. Tools from this server are no longer available

Security Considerations

Authentication

API Keys and Tokens:

  • Store in environment variables
  • Never commit to version control
  • Rotate regularly
  • Use minimal permissions

Example (secure):

{
  "env": {
    "API_KEY": "${MCP_SERVICE_KEY}"
  }
}

Permissions

Principle of Least Privilege:

  • Grant minimal necessary access
  • Use read-only when possible
  • Restrict file system access to specific directories
  • Audit tool usage regularly

Network Security

For HTTP/SSE servers:

  • Use HTTPS when possible
  • Validate SSL certificates
  • Restrict network access
  • Monitor for unusual activity

Troubleshooting

Server Won't Connect

Check:

  • Command/URL is correct
  • Server process can start
  • Network accessibility (for HTTP/SSE)
  • Environment variables are set

Debug:

# Test stdio server manually
npx -y @modelcontextprotocol/server-filesystem /path

# Check server output
# Should show protocol negotiation

Tools Not Appearing

  • Verify server is enabled
  • Check agent has MCP tools enabled
  • Restart TalkCody
  • Check server logs for errors

Tool Execution Fails

  • Verify permissions (file access, API limits)
  • Check authentication credentials
  • Review error messages from server
  • Test tool with minimal parameters

Performance Issues

  • Limit number of active servers
  • Use local servers when possible
  • Cache frequently accessed data
  • Optimize custom server implementations

Best Practices

Server Organization

  • Use descriptive names
  • Group related servers
  • Document purpose and usage
  • Keep configurations version controlled (without secrets)

Tool Usage

  • Enable MCP tools selectively per agent
  • Monitor tool usage and costs
  • Set appropriate timeouts
  • Handle errors gracefully

Development Workflow

  1. Develop locally: Test with stdio servers
  2. Stage: Move to HTTP for team access
  3. Production: Use hosted MCP servers
  4. Monitor: Track usage and performance

Next Steps

Resources

MCP servers unlock unlimited potential for extending TalkCody. Start with official servers and explore custom integrations!