MCP Usage

Once you've set up your MCP servers, you can start using them in your conversations to extend your AI model's capabilities. This guide explains how to enable and use MCP servers in your chats.

Prerequisites

Before using MCP servers in conversations, make sure you have:

  1. Configured MCP servers: Follow the MCP Setup guide to add and configure your MCP servers
  2. Tool-capable model: You need a model that supports tool/function calling

Creating a Chat with MCP

1. Start a New Chat

  1. Open OllamaC
  2. Click New Chat or the + button to create a new conversation

2. Select a Tool-Capable Model

This is a crucial step - only models with tool/function calling capabilities can use MCP servers.

  1. In the model selector, look for models labeled with "Tool" capability
  2. Common tool-capable models include:
    • Llama 3.1 and newer versions
    • Qwen2.5 series
    • Mistral models with tool support
    • CodeLlama variants with tool support

Important: If you don't select a model with tool capability, the MCP server selector will not be available.

3. Choose Your MCP Server

Once you've selected a tool-capable model:

  1. Look for the MCP Server selector (this appears only after selecting a tool-capable model)
  2. Click on the dropdown to see all your configured and enabled MCP servers
  3. Select the MCP server you want to use for this conversation

You can choose from:

  • Local servers you've configured (e.g., filesystem, git, database servers)
  • Remote servers you've set up (e.g., API integrations, web services)

4. Start Your Conversation

With both a tool-capable model and an MCP server selected, you can now start chatting. The AI will have access to the capabilities provided by your chosen MCP server.

Using MCP Capabilities

Example Interactions

Here are some examples of what you can do with different types of MCP servers:

File System Server

You: "Can you read the contents of my project's README file?"
AI: I'll read the README file for you using the filesystem server.

Git Server

You: "What are the recent commits in my repository?"
AI: Let me check the recent git commits using the git server.

Web/API Server

You: "Can you fetch the latest news about AI from the web?"
AI: I'll use the web scraping server to get the latest AI news for you.

Database Server

You: "Show me all users in the database who registered this month"
AI: I'll query the database using the SQLite server to find recent users.

How It Works

When you make a request that requires external data or actions:

  1. AI Analysis: The model analyzes your request and determines if it needs to use the MCP server
  2. Tool Invocation: The model calls the appropriate function/tool from the MCP server
  3. Data Processing: The MCP server processes the request and returns results
  4. Response Generation: The model incorporates the results into its response

Managing Multiple Servers

Switching Servers Mid-Conversation

Currently, you select one MCP server per conversation. To use a different server:

  1. Start a new chat
  2. Select your desired model and MCP server combination
  3. Continue your conversation with the new server's capabilities

Server-Specific Capabilities

Different MCP servers provide different capabilities:

  • Filesystem servers: File reading, writing, directory listing
  • Git servers: Repository operations, commit history, branch management
  • Web servers: HTTP requests, web scraping, API calls
  • Database servers: SQL queries, data retrieval, database operations
  • Custom servers: Specialized business logic or integrations

Best Practices

1. Choose the Right Server

Select the MCP server that best matches your task:

  • Use filesystem servers for file operations
  • Use web servers for online research
  • Use database servers for data analysis
  • Use specialized servers for domain-specific tasks

2. Be Specific in Requests

The more specific you are, the better the AI can utilize the MCP server:

Good: "Read the package.json file and show me the dependencies" Better: "Read the package.json file from the project root and list all production dependencies with their versions"

3. Understand Server Limitations

Each MCP server has its own:

  • Scope: What it can and cannot access
  • Permissions: What operations it's allowed to perform
  • Rate limits: How frequently it can be used

4. Security Considerations

  • Only use MCP servers from trusted sources
  • Be aware of what data and systems each server can access
  • Review server permissions regularly

Troubleshooting

Common Issues

MCP Server Selector Not Visible

  • Ensure you've selected a model with "Tool" capability
  • Check that you have at least one MCP server configured and enabled

Server Not Responding

  • Verify the server is running and accessible
  • Check the server configuration in Settings
  • Review any error messages in the conversation

Permission Denied Errors

  • Ensure the MCP server has necessary permissions
  • Check file paths and access rights
  • Verify API keys and authentication credentials

Unexpected Results

  • The AI might misinterpret your request
  • Try being more specific about what you want
  • Consider if a different MCP server might be more appropriate

Getting Help

If you encounter issues:

  1. Check that your MCP servers are properly configured (see Setup)
  2. Verify your system meets the requirements
  3. Review error messages for specific guidance
  4. Try with a different tool-capable model

Advanced Usage

Combining Multiple Capabilities

While you can only use one MCP server per conversation, you can:

  1. Chain conversations: Use results from one chat as input to another with a different server
  2. Copy data: Transfer information between conversations manually
  3. Plan workflows: Design multi-step processes across different server capabilities

Custom Workflows

Consider creating workflows that leverage MCP servers for:

  • Code analysis: Use filesystem + git servers to analyze codebases
  • Data research: Combine web scraping with database operations
  • Content creation: Use multiple data sources to generate comprehensive content
  • System monitoring: Integrate with APIs and local system tools

Next Steps

Now that you know how to use MCP servers:

  1. Experiment with different server and model combinations
  2. Explore the capabilities of each server type
  3. Consider setting up additional servers for your specific use cases
  4. Share your workflows and discoveries with the community