Recommended setup: Ollama with Codex
- Create the SourceShelf share and copy its command.
- Add it to Codex using the Codex guide.
- Launch Codex through Ollama:
ollama launch codex- Choose an installed model with a sufficiently large context window and reliable tool calling.
- In Codex, run
/mcpand confirm the SourceShelf server and its two tools are present. - Ask:
Search the SourceShelf pack for public transit ridership trends, read the best result, and cite the resource URI.
Ollama recommends at least a 64K context window for coding agents. SourceShelf’s search-first workflow reduces unnecessary context, but the agent itself may still need room for tool definitions and results.
Ollama with OpenCode
- Configure SourceShelf in OpenCode using the OpenCode guide.
- Start the local agent through Ollama:
ollama launch opencodeOllama says it deep-merges the temporary launch configuration with an existing OpenCode configuration, so your SourceShelf MCP entry remains available.
Ollama with Claude Code
- Configure SourceShelf using the Claude Code guide.
- Launch:
ollama launch claudeThen use /mcp in Claude Code to confirm the server.
Manual local-model mode in Codex
If your Codex setup already points to Ollama, you can also start it with:
codex --ossThe MCP configuration remains in Codex; --oss chooses the local open-source model provider. If you maintain multiple local providers, use a named Codex profile instead.
Choosing a model
Look for a model whose Ollama page or documentation explicitly mentions tool/function calling. Smaller models benefit from direct prompts such as:
Call
search_packfirst. Useread_pack_resourceonly on the top result. Do not guess and do not read the entire pack.
If the model repeatedly writes a hypothetical tool call as text, the host connection may be working while the model’s tool-call behavior is not. Confirm with a stronger tool-capable model before debugging SourceShelf.
Advanced: build your own bridge
An application using Ollama’s chat API can define functions and execute them, but it must also implement an MCP client or translate those functions to SourceShelf’s MCP calls. SourceShelf intentionally does not provide a network endpoint. For normal testing, an existing agent host is much simpler and safer.
Official references: Ollama tool calling, Ollama launch, Ollama with Codex, Ollama with OpenCode, Ollama with Claude Code.