MCP: Intro and Setup

Introduction to MCP (Model Context Protocol)

The Model Context Protocol (MCP) is a powerful communication protocol that enables Tabnine Agents to seamlessly connect with external tools and services, dramatically expanding their capabilities beyond code analysis and generation.

What is MCP?

MCP is a standardized protocol that allows AI agents to invoke external tools without the complexity of manually wiring APIs. Think of it as a universal translator that lets your agent communicate with any service that supports MCP.

Key Benefits

  • Universal Integration: Connect to any MCP-compatible service

  • Natural Language Interface: Agents understand when and how to use tools

  • Automated Parameter Handling: No manual API configuration needed

  • Seamless Workflow Integration: Tools become part of your agent’s capabilities

The MCP Flow

  1. Tool Description: MCP servers provide natural language descriptions of their capabilities

  2. Intelligent Selection: Agents understand when to use specific tools based on context

  3. Parameter Mapping: Agents automatically format parameters correctly

  4. Response Processing: Agents interpret tool responses and integrate them into workflows

Available MCP Integrations

Development Tools

Git Operations

  • Repository management

  • Branch operations

  • Commit history analysis

  • Merge conflict resolution

Docker & Containers

  • Container management

  • Image building and deployment

  • Service orchestration

  • Environment setup

Project Management

JIRA Integration

  • Issue creation and management

  • Sprint planning

  • Status updates

  • Progress tracking

Confluence

  • Documentation access

  • Knowledge base queries

  • Content creation

  • Team collaboration

Database Tools

Database Operations

  • Query execution

  • Schema management

  • Data analysis

  • Performance monitoring

Cloud Services

AWS/Azure/GCP

  • Resource provisioning

  • Deployment automation

  • Monitoring and logs

  • Security management

Custom Integrations

Your Own APIs

  • Internal tool integration

  • Custom workflow automation

  • Legacy system access

  • Specialized functionality

MCP Use Cases

Automated Workflows

Feature Development + Project Management

You: "Implement user authentication and update the project tracker"
Agent:
1. Implements authentication code
2. Creates JIRA tickets for testing
3. Updates Confluence documentation
4. Commits changes to Git
5. Updates project status

Bug Investigation + Resolution

You: "Investigate database performance issues"
Agent:
1. Queries database performance metrics
2. Analyzes slow query logs
3. Creates JIRA issue with findings
4. Implements optimizations
5. Validates improvements

Cross-Platform Operations

Code + Documentation + Deployment

You: "Deploy the new feature to staging"
Agent:
1. Runs tests via testing tools
2. Builds Docker images
3. Deploys to cloud platform
4. Updates deployment documentation
5. Notifies team via Slack

Technical Requirements

Prerequisites

  • Tabnine Agent Mode: MCP requires tool-calling capabilities

  • Node.js Runtime: For most MCP server implementations

  • Network Access: To communicate with external services

  • Docker (optional): For containerized MCP servers

Security Considerations

  • Authentication: MCP servers handle service authentication

  • Permissions: Agents respect tool permission boundaries

  • Data Privacy: Sensitive data stays within your environment

  • Audit Trail: All tool interactions are logged

MCP Server Configuration

MCP servers are configured through a mcp_servers.json file under the .tabnine directory in your project root:

{
    "mcpServers":
    {
        "server-name":
        {
            "command": "server-executable",
            "args":
            [
                "arg1",
                "arg2"
            ],
            "env":
            {
                "API_KEY": "your-api-key",
                "BASE_URL": "<https://api.example.com>"
            }
        }
    }
}

Configuration Components

  • Command “command”: The executable or script that runs the MCP server

  • Arguments “args”: Command-line arguments for the server

  • Environment “env”: Environment variables for authentication and configuration

Getting Started with MCP

1. Choose Your Integration

Identify which external tools would benefit your workflow:

  • Project management (JIRA, GitHub Issues)

  • Documentation (Confluence, Notion)

  • Infrastructure (AWS, Docker)

  • Databases (PostgreSQL, MongoDB)

2. Set Up MCP Server

Each tool has its own MCP server implementation. Most are available as:

  • Docker containers

  • Node.js packages

  • Python scripts

  • Pre-built binaries

3. Configure Tabnine

Add the MCP server configuration to your mcp_servers.json file with appropriate credentials and settings.

4. Test Integration

Verify the connection by asking your agent to interact with the service:

"Can you see the JIRA MCP server?"
"List my recent JIRA issues"

Best Practices

Tool Selection

  • Start Small: Begin with one or two critical integrations

  • Focus on Workflow: Choose tools that automate your most common tasks

  • Consider Security: Ensure proper authentication and permissions

Configuration Management

  • Environment Variables: Use env vars for sensitive information

  • Version Control: Track MCP configurations (excluding secrets)

  • Documentation: Document your MCP setup for team members

Agent Interactions

  • Be Specific: Clearly state which tools should be used when needed

  • Understand Limitations: Know what each tool can and cannot do

  • Monitor Usage: Track tool usage and effectiveness

Troubleshooting MCP

Common Issues

Connection Problems

  • Verify MCP server is running

  • Check network connectivity

  • Validate authentication credentials

Permission Errors

  • Ensure proper API permissions

  • Verify service account configuration

  • Check rate limiting settings

Performance Issues

  • Monitor tool response times

  • Consider caching strategies

  • Optimize query patterns

Debugging Steps

  1. Check Logs: Review Tabnine logs for MCP errors

  2. Test Manually: Verify tool works outside of MCP

  3. Validate Config: Ensure mcp_servers.json file is correct

  4. Update Servers: Keep MCP servers up to date

Setting up MCP with Tabnine Agents

This guide provides step-by-step instructions for configuring Model Context Protocol (MCP) servers to work with Tabnine Agents, enabling seamless integration with external tools and services.

Quick Setup Overview

  1. Create MCP Configuration: Under your project root directory, create a .tabnine directory, and inside it create a file called mcp_servers.json

  2. Install MCP Server: Choose and install your desired MCP server

  3. Configure Authentication: Set up API keys and credentials

  4. Test Connection: Verify integration works with Tabnine

  5. Start Using: Begin leveraging external tools in your workflows

1. Create MCP Configuration File

Under your project root directory, create a subdirectory .tabnine and under it create a file mcp_servers.json. This file will contain the configuration for all your MCP servers.

2. Basic Configuration Structure

The mcp_servers.json file uses JSON format:

{
    "mcpServers":
    {
        "server-name":
        {
            "command": "command-to-run-server",
            "args":
            [
                "argument1",
                "argument2"
            ],
            "env":
            {
                "ENV_VARIABLE": "value"
            }
        }
    }
}

Configuration Parameters

  • command: The executable that runs the MCP server

  • args: Array of command-line arguments

  • env: Environment variables for the server (API keys, URLs, etc.)

3. Authentication Setup

API Token Creation

  1. For JIRA/Confluence:

    1. Go to Atlassian Account Settings

    2. Navigate to Security → API Tokens

    3. Create a new token

    4. Copy and store securely

  2. For GitHub:

    1. Go to GitHub Settings → Developer Settings

    2. Personal Access Tokens → Tokens (classic)

    3. Generate new token with appropriate scopes

    4. Copy and store securely

  3. For Databases:

    1. Create a dedicated service account

    2. Grant minimum required permissions

    3. Use connection strings with authentication

Instead of hardcoding credentials, use environment variables:

{
    "mcpServers":
    {
        "mcp-atlassian":
        {
            "command": "docker",
            "args":
            [
                "run",
                "-i",
                "--rm",
                "-e",
                "JIRA_URL",
                "-e",
                "JIRA_API_TOKEN",
                "mcp-atlassian:latest"
            ],
            "env":
            {
                "JIRA_URL": "${JIRA_URL}",
                "JIRA_API_TOKEN": "${JIRA_API_TOKEN}"
            }
        }
    }
}

Then set environment variables:

export JIRA_URL="<https://your-company.atlassian.net>"
export JIRA_API_TOKEN="your_token_here"

4. Verify MCP Server Connection

Test the Connection

Ask your Tabnine Agent:

"Are you able to see the JIRA MCP server?"

Expected Response:

  • ✅ “Yes, I can see the JIRA MCP server and access its capabilities”

  • ❌ “No, I cannot connect to the JIRA MCP server”

Basic Functionality Test

Try a simple operation:

"List my recent JIRA issues"
"Search for 'authentication' in Confluence"
"Show me the database schema"

Best Practices

Security

  • Never commit API tokens to version control

  • Use environment variables for all sensitive data

  • Implement least privilege access for service accounts

  • Regularly rotate API tokens

Performance

  • Start with essential tools to avoid overwhelming the agent

  • Monitor response times and optimize configurations

  • Use caching where appropriate

  • Consider rate limiting for API-heavy operations

Maintenance

  • Keep MCP servers updated to the latest versions

  • Document your configuration for team members

  • Test integrations regularly to catch issues early

  • Monitor usage patterns to optimize workflows

Next Steps

Now that you have MCP configured, explore:

  • MCP Examples - Real-world use cases and workflows

  • Guidelines Setup - Customize agent behavior

Last updated

Was this helpful?