You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Model Context Protocol (MCP) plugin enables OptiLLM to connect with MCP servers, bringing external tools, resources, and prompts into the context of language models. This allows for powerful integrations with filesystem access, database queries, API connections, and more.
341
341
342
+
OptiLLM supports both **local** and **remote** MCP servers through multiple transport methods:
343
+
-**stdio**: Local servers (traditional)
344
+
-**SSE**: Remote servers via Server-Sent Events
345
+
-**WebSocket**: Remote servers via WebSocket connections
346
+
342
347
#### What is MCP?
343
348
344
349
The [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) is an open protocol standard that allows LLMs to securely access tools and data sources through a standardized interface. MCP servers can provide:
@@ -351,59 +356,186 @@ The [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) is an open
351
356
352
357
##### Setting up MCP Config
353
358
359
+
> **Note on Backwards Compatibility**: Existing MCP configurations will continue to work unchanged. The `transport` field defaults to "stdio" when not specified, maintaining full backwards compatibility with existing setups.
360
+
354
361
1. Create a configuration file at `~/.optillm/mcp_config.json` with the following structure:
"description": "GitHub repository and issue management"
407
539
}
408
540
},
409
541
"log_level": "INFO"
@@ -429,11 +561,18 @@ The plugin enhances the system prompt with MCP capabilities so the model knows w
429
561
430
562
Here are some examples of queries that will engage MCP tools:
431
563
564
+
**Local Server Examples:**
432
565
- "List all the Python files in my documents directory" (Filesystem)
433
566
- "What are the recent commits in my Git repository?" (Git)
434
567
- "Search for the latest information about renewable energy" (Search)
435
568
- "Query my database for all users who registered this month" (Database)
436
569
570
+
**Remote Server Examples:**
571
+
- "Show me the open issues in my GitHub repository" (GitHub MCP)
572
+
- "Create a new branch for the feature I'm working on" (GitHub MCP)
573
+
- "What are the most recent pull requests that need review?" (GitHub MCP)
574
+
- "Get the file contents from my remote repository" (GitHub MCP)
575
+
437
576
#### Troubleshooting
438
577
439
578
##### Logs
@@ -447,13 +586,35 @@ Check this log file for connection issues, tool execution errors, and other diag
447
586
448
587
##### Common Issues
449
588
589
+
**Local Server Issues (stdio transport):**
590
+
450
591
1.**Command not found**: Make sure the server executable is available in your PATH, or use an absolute path in the configuration.
451
592
452
-
2.**Connection failed**: Verify the server is properly configured and any required API keys are provided.
593
+
2.**Access denied**: For filesystem operations, ensure the paths specified in the configuration are accessible to the process.
594
+
595
+
**Remote Server Issues (SSE/WebSocket transport):**
596
+
597
+
3.**Connection timeout**: Remote servers may take longer to connect. Increase the `timeout` value in your configuration.
598
+
599
+
4.**Authentication failed**: Verify your API keys and tokens are correct. For GitHub MCP server, ensure your `GITHUB_TOKEN` environment variable is set with appropriate permissions.
600
+
601
+
5.**Network errors**: Check your internet connection and verify the server URL is accessible.
602
+
603
+
6.**Environment variable not found**: If using `${VARIABLE_NAME}` syntax, ensure the environment variables are set before starting OptILLM.
604
+
605
+
**General Issues:**
606
+
607
+
7.**Method not found**: Some servers don't implement all MCP capabilities (tools, resources, prompts). Verify which capabilities the server supports.
608
+
609
+
8.**Transport not supported**: Ensure you're using a supported transport: "stdio", "sse", or "websocket".
610
+
611
+
**Example: Testing GitHub MCP Connection**
453
612
454
-
3.**Method not found**: Some servers don't implement all MCP capabilities (tools, resources, prompts). Verify which capabilities the server supports.
613
+
To test if your GitHub MCP server configuration is working:
455
614
456
-
4.**Access denied**: For filesystem operations, ensure the paths specified in the configuration are accessible to the process.
615
+
1. Set your GitHub token: `export GITHUB_TOKEN="your-github-token"`
616
+
2. Start OptILLM and check the logs at `~/.optillm/logs/mcp_plugin.log`
617
+
3. Look for connection success messages and discovered capabilities
0 commit comments