Skip to content

bug(mcp): uteke-mcp ignores [embedding] and [vector] of uteke.toml and UTEKE_EMBEDDING_* (always ONNX) #1535

Closed

Description

@ajianaz

Problem

uteke-mcp opens the store with Uteke::open(path), which uses the built-in embedding backend (onnx), default embedding settings and no vector-engine preference. It reads none of: [embedding] (backend, model, api_key, base_url, endpoint_path, dims, max_seq_length) and [vector] backend from uteke.toml, nor UTEKE_EMBEDDING_BACKEND. The backend variable is resolved by the CLI (apply_env_overrides) and by uteke-serve (resolve_embedding), not by the core, so the MCP binary can never select a backend other than onnx. The core does read UTEKE_EMBEDDING_MODEL, _BASE_URL, _ENDPOINT_PATH, _API_KEY and _DIMS (and UTEKE_VECTOR_BACKEND), but only the openai and ollama backends use them, and MCP cannot select those, so for MCP they have no effect.

So the same store is written with a different embedder over MCP than over the CLI or the server once a user configures anything but ONNX, and the MCP side does it silently.

Evidence (binaries built from develop at 2026-10-22, real ONNX model in a throwaway UTEKE_HOME)

Config: [embedding] backend = "ollama", base_url = "http://127.0.0.1:1" (nothing listens there), or the same through UTEKE_EMBEDDING_BACKEND=ollama UTEKE_EMBEDDING_BASE_URL=http://127.0.0.1:1.

Entry point Result
uteke remember --json embedding_written: false, warning Ollama embed request failed ... (the configured backend is used)
uteke_remember over MCP Stored memory with ID ..., no warning: it embedded with ONNX
no configuration, both embedded with ONNX

Consequences

  • A user who configured openai or ollama (or a custom dims) gets vectors from a different model written into the same index by MCP, or a dimension mismatch when the dimensions differ. Recall quality degrades or the vector write fails, and nothing says why.
  • The vector-engine preference ([vector] backend) is ignored too (UTEKE_VECTOR_BACKEND is honoured).
  • MCP over HTTP (POST /mcp on uteke-serve) is not affected: it runs inside the server, which opens the store from its own resolved settings.

Direction

Resolve the embedding backend, settings and vector preference in one place (the core, next to EngineSettings from #1515) and use it from the CLI, the server and MCP; the MCP binary then opens with open_with_embedding_and_graph like the others. Both existing resolvers (CLI apply_env_overrides, server resolve_embedding) have the same precedence rules, so the move should not change them; keep their tests.

Behaviour impact

MCP changes for users who configured a non-ONNX backend: it starts honouring it (and surfaces an unreachable backend as a warning instead of silently using ONNX). CORE note for uteke-cloud before merging (same as #1515 part 4).

Acceptance

Found while reviewing #1515 part 4 (#1533). Related: #1355, #1515, #1523.

Activity

  1. added
    bugSomething isn't working
    scope:mcpMCP (Model Context Protocol) server tools
    on Oct 22, 2026
  2. ajianaz commented on Oct 22, 2026

    @ajianaz
    CollaboratorAuthor

    Superseded in scope by #1537 (step 2 of the resolution issue closes this one). Contract issue for the MCP behaviour change: https://gitea.azfirazka.com/codecoradev/uteke-cloud/issues/254. Reproduced and corrected here (the core does read UTEKE_EMBEDDING_MODEL, _BASE_URL, _API_KEY and _DIMS; only the backend variable is missing).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority:mediumFix soonscope:coreCore engine workscope:mcpMCP (Model Context Protocol) server tools

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions