|
42 | 42 | - [Autocomplete and Prompt Features](#autocomplete-and-prompt-features) |
43 | 43 | - [Configuration Management](#configuration-management) |
44 | 44 | - [Server Configuration Format](#server-configuration-format) |
| 45 | + - [Tips: Where to Put MCP Server Configs and a Working Example](#tips-where-to-put-mcp-server-configs-and-a-working-example) |
45 | 46 | - [Compatible Models](#compatible-models) |
46 | 47 | - [Ollama Cloud Models](#ollama-cloud-models) |
47 | 48 | - [Where Can I Find More MCP Servers?](#where-can-i-find-more-mcp-servers) |
@@ -519,6 +520,57 @@ The JSON configuration file supports STDIO, SSE, and Streamable HTTP server type |
519 | 520 | > [!NOTE] |
520 | 521 | > **MCP 1.10.1 Transport Support**: The client now supports the latest Streamable HTTP transport with improved performance and reliability. If you specify a URL without a type, the client will default to using Streamable HTTP transport. |
521 | 522 |
|
| 523 | +### Tips: where to put MCP server configs and a working example |
| 524 | + |
| 525 | +A common point of confusion is where to store MCP server configuration files and how the TUI's save/load feature is used. Here's a short, practical guide that has helped other users: |
| 526 | + |
| 527 | +- The TUI's `save-config` / `load-config` (or `sc` / `lc`) commands are intended to save *TUI preferences* like which tools you enabled, your selected model, thinking mode, and other client-side settings. They are not required to register MCP server connections with the client. |
| 528 | +- For MCP server JSON files (the `mcpServers` object shown above) we recommend keeping them outside the TUI config directory or in a clear subfolder, for example: |
| 529 | + |
| 530 | +``` |
| 531 | +~/.config/ollmcp/mcp-servers/config.json |
| 532 | +``` |
| 533 | + |
| 534 | +You can then point `ollmcp` at that file at startup with `-j` / `--servers-json`. |
| 535 | + |
| 536 | +> [!IMPORTANT] |
| 537 | +> When using HTTP-based MCP servers, use the `streamable_http` type (not just `http`). |
| 538 | +
|
| 539 | +Here a minimal working example let's say this is your `~/.config/ollmcp/mcp-servers/config.json`: |
| 540 | + |
| 541 | +```json |
| 542 | +{ |
| 543 | + "mcpServers": { |
| 544 | + "github": { |
| 545 | + "type": "streamable_http", |
| 546 | + "url": "https://api.githubcopilot.com/mcp/", |
| 547 | + "headers": { |
| 548 | + "Authorization": "Bearer mytoken" |
| 549 | + } |
| 550 | + } |
| 551 | + } |
| 552 | +} |
| 553 | +``` |
| 554 | + |
| 555 | +> [!TIP] |
| 556 | +> When using GitHub MCP server, make sure to replace `"mytoken"` with your actual GitHub API token. |
| 557 | +
|
| 558 | +With that file in place you can connect using: |
| 559 | + |
| 560 | +``` |
| 561 | +ollmcp -j ~/.config/ollmcp/mcp-servers/config.json |
| 562 | +``` |
| 563 | + |
| 564 | +Here you can find a GitHub issue related to this common pitfall: https://github.com/jonigl/mcp-client-for-ollama/issues/112#issuecomment-3446569030 |
| 565 | + |
| 566 | +#### Demo |
| 567 | + |
| 568 | +A short demo (asciicast) that should help anyone reproduce the working setup quickly. This example uses an [MCP server example with streamable HTTP protocol](https://github.com/jonigl/mcp-server-with-streamable-http-example) usage: |
| 569 | + |
| 570 | +[](https://asciinema.org/a/751387) |
| 571 | + |
| 572 | + |
| 573 | + |
522 | 574 | ## Compatible Models |
523 | 575 |
|
524 | 576 | The following Ollama models work well with tool use: |
@@ -579,6 +631,7 @@ This repository contains reference implementations for the Model Context Protoco |
579 | 631 | ## Related Projects |
580 | 632 |
|
581 | 633 | - **[Ollama MCP Bridge](https://github.com/jonigl/ollama-mcp-bridge)** - A Python API layer that sits in front of Ollama, automatically adding tools from multiple MCP servers to every chat request. This project provides a transparent proxy solution that pre-loads all MCP servers at startup and seamlessly integrates their tools into the Ollama API. |
| 634 | +- **[MCP Server with Streamable HTTP Example](https://github.com/jonigl/mcp-server-with-streamable-http-example)** - An example MCP server demonstrating the usage of the streamable HTTP protocol. |
582 | 635 |
|
583 | 636 | ## License |
584 | 637 |
|
|
0 commit comments