docs(mcp): fix Ollama config example to use nested provider schema - #1702
Open
xiaoyaner0201 wants to merge 3 commits into
Open
docs(mcp): fix Ollama config example to use nested provider schema#1702xiaoyaner0201 wants to merge 3 commits into
xiaoyaner0201 wants to merge 3 commits into
Conversation
xiaoyaner0201
marked this pull request as ready for review
July 30, 2026 17:22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1556.
Problem
The "Using Ollama for Local LLM" example in
mcp_server/README.mddocuments a flat provider schema that the current config models no longer accept. Copying it verbatim fails to construct either client:Two independent defects in the same block:
llm.api_base/llm.api_keyare not fields onLLMConfig.mcp_server/src/config/schema.pyrequires the endpoint underproviders.openai.api_url. With the documented shape,config.providers.openaistaysNone, soLLMClientFactory.createraises — andis_non_openai_provider()never sees the Ollama URL, so even if construction succeeded the routing would be wrong.embedder.provider: sentence_transformersis not a supported provider.EmbedderProvidersConfigsupportsopenai | azure_openai | gemini | voyage;sentence_transformersfalls tocase _and raises. Ollama serves embeddings on the same OpenAI-compatible endpoint, soopenaiis the correct provider here.Change
Docs-only rewrite of the Ollama YAML block to the nested
providers:schema already used elsewhere in this README and inmcp_server/config/config.yaml, plus a regression test.The test (
mcp_server/tests/test_readme_config_examples.py) extracts the YAML fromREADME.mdat runtime rather than copying it — so it is a real drift fence: if the section reverts to the flat shape, the test goes RED again. It asserts the documented endpoint lands onproviders.openai.api_url, thatLLMClientFactory.createactually returns anOpenAIGenericClient(Chat Completions path), thatEmbedderFactory.createconstructs, and that every embedderprovider:appearing in the README is in the factory's supported set.No
schema.py/factories.pychanges. No new provider added. No other README section touched.Test plan
Base:
71a719be482294dd4bbfc5cef557a3a6a500c134. No network, no API key, no database required.Related regressions are clean, so no baseline attribution was needed.
ruff checkandruff format --checkon the new test file are clean.Independent adversarial probes were run on throwaway copies of the tree: reverting the README block, renaming the section heading, and swapping
api_urlto the official OpenAI endpoint each make the test fail as intended — confirming the fence bites rather than passing vacuously.Refresh onto current main
Branch refreshed via merge of
upstream/main(2645dee, the only upstream delta being a CLA record insignatures/version1/cla.json) at head864d41ee8a677f42f2d0958c3170c28882420fa3. The two-file candidate patch is byte-identical before/after the refresh (patch SHA-256b4c26640b75a7a72b21be8570b7a7280114a28ccc9366806ad7b367d8b1186d5). Post-refresh re-verification: 36 focused tests pass,ruff check/ruff format --checkclean, and an independent read-only review of the exact tree found zero unresolved findings.CI note
The
triagecheck failure on this PR is a known infrastructure problem in theanthropics/claude-code-actionrunner when triaging fork PRs, not a defect in this change — the job log showsInternal error: directory mismatch for directory ".../claude-code-action/.../tsconfig.json", fd 4. You don't need to do anything, but this indicates a bug.(https://github.com/getzep/graphiti/actions/runs/30499248316/job/90735021052). All candidate-owned checks (ruff, CLA, Socket,check-fork) are green.Notes
Docs + test only; no runtime behavior change.