* fix(mcp): let operators declare Fake-IP ranges for self-service servers
A local proxy in Fake-IP mode (Loon, Clash, Surge) answers DNS for public
hostnames with synthetic private addresses, e.g. fd27:712::/32 from Loon,
and routes the connection by hostname. Strict validation then rejects
public MCP Store entries such as GitMCP as private-network targets.
Add DEEPTUTOR_MCP_FAKE_IP_RANGES (comma separated CIDRs, opt-in, read from
the process environment). In strict mode an address a hostname resolves to
inside a declared range is no longer rejected as private. IP-literal URLs,
loopback and the link-local/metadata ranges stay blocked regardless, and
any other private answer for the same host still fails validation.
Closes#2789
Assisted-by: Claude <noreply@anthropic.com>
* fix(mcp): warn on Fake-IP opt-in and document single-user SSRF trade-offs
Address review feedback from JinhangHE126 on #2857:
Document clearly that DEEPTUTOR_MCP_FAKE_IP_RANGES relaxes hostname-based SSRF protection for hostnames resolving into declared ranges (as the proxy resolves targets and connects).
Emit a startup security warning when DEEPTUTOR_MCP_FAKE_IP_RANGES is set, noting that the setting is intended strictly for single-user/desktop installations.
Assisted-by: Gemini (Google Vertex AI)
Local dev repairs for #2586.
OAuth owner isolation and refresh-token stability verified. Hook polls until connected, refreshes on focus and stops on unmount. Python rechecks: 56 passed; UI batch: 25 passed. Web typecheck, 1407 Node tests, eslint and i18n passed.
Exercise same-origin metadata redirects and cross-origin redirect rejection
through the SDK's public HTTPX auth interface. Document why the discovery
extension uses the inner generator to retain SDK redirect handling.
Co-Authored-By: GPT-6 Astra
Remove the successful-exchange issuer stamp so resource-origin fallback
grants cannot be rebound to a different PRM-advertised authorization server.
Keep unbound grants subject to renewed authorization before refresh.
Add offline HTTPX regression coverage for cross-origin fallback across
restart and metadata changes, same-origin unbound grants, and verified
cross-origin refresh.
Co-Authored-By: GPT-6 Astra
Adds PageIndex OSS as a knowledge-base type and moves PageIndex retrieval from traditional RAG to reasoning-based retrieval: a small workflow-owned agent loop reads the document tree instead of going through the built-in MCP server, which this removes.
The `mcp` client was declared only under the `partners` extra, but the MCP
connection manager and the built-in PageIndex MCP server are core: the manager
overlays a reserved `pageindex` entry onto the config whenever a PageIndex API
key is set, on any turn. A plain `pip install deeptutor` therefore had no `mcp`,
so the connection task raised ModuleNotFoundError, never resolved the caller's
ready future, and every turn stalled for the full 15s connect timeout before
reporting the one cause that was not responsible: "connect timed out after 15s".
Declare `mcp>=1.26.0,<2.0.0` as a core dependency of both published
distributions and drop it from the `partners` extra, which now inherits it.
Mirror the move in requirements/ (cli.txt gains it, partners.txt inherits it
via server.txt).
Also import `mcp` inside `_run_server`'s guarded block rather than above it. At
function scope the import raised before anything could fail `ready`, which is
what turned a permanent, instantly-knowable error into a timeout plus an
orphaned "Task exception was never retrieved". Inside the block the real cause
reaches the caller immediately.
Closes#792
* update
* fix(mcp): reconnect on credential change; stop masking transport errors as timeouts
Two independent bugs, both surfaced connecting a remote MCP server that
authenticates with a header key.
connection_signature() fingerprints the stored config, which holds
${secret:...} references rather than values, so rotating a credential left
the reload diff byte-identical and the session kept using the replaced key
until the process restarted. _signature() now mixes in a digest of the
materialized config. The digest, never the value, reaches the signature;
configs with no references keep their plain signature, so this does not
invalidate and drop every live session on upgrade.
A transport failure on the POST carrying a tool call is raised inside the
SDK's own anyio task group and never resolves the caller's request, so a
call that failed in under a second was reported as a tool timeout -- the
one explanation that rules out the actual cause. call_tool() now watches
the connection task alongside the call and reports the error that task
recorded. _run_server() routes its post-live failure through the existing
describe_connect_failure(), so that string names the HTTP status rather
than "unhandled errors in a TaskGroup".
Tests: tests/services/mcp/test_call_failures.py
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* docs: add Open Source Partners section with PageIndex
* docs: replace partner blurb with PageIndex promo code
* docs: link PageIndex subscription to developer portal
* docs: point PageIndex logo at its GitHub repo
* fix: harden Responses stream parsing (#825)
* fix: remove obsolete Typer extra (#817)
* fix: normalize RAG citation payloads (#808)
* fix: decouple mastery paths from chat sessions (#810)
* fix(llm): mark OpenAI Codex as vision capable (#821)
Declare the Codex Responses provider as image-capable so multimodal calls do not silently degrade to text and RAG image indexing can use it. Cover capability resolution, fallback behavior, and input_image conversion.
* fix: return minimal reasoning_effort for Gemini 3 and 2.5 Pro (#809)
Gemini 3 models and Gemini 2.5 Pro reject reasoning_effort="none"
with a 400 INVALID_ARGUMENT error. Per Google's OpenAI-compat docs,
"none" is only valid for the 2.5 Flash family.
Return "minimal" (the lowest valid level) for Gemini 3 and 2.5 Pro,
preserving the cost-intent while avoiding the API error.
Fixes#734
Co-authored-by: 0xtidalbore <ahmed@itcloud.ca>
* fix(mcp): don't orphan a cancelled call, or leak a URL credential
Follow-ups to this branch's own two fixes, both on paths it opened:
- ``asyncio.wait`` — unlike ``gather`` — leaves the futures it waits on
running when the *waiter* is cancelled, and the call was moved into a
free-standing task, so nothing else would ever stop it. Stopping a turn
left the tool running against the server with its result discarded.
Cancel and absorb it whenever the wait is interrupted, sharing one
``_abandon`` helper with the connection-died path.
- A dead transport is now reported to the *model*, not just in settings,
and httpx names the full request URL in its message. ``CredentialTarget``
includes "url_param" and several curated servers use it, so that string
can carry an API key. Redact query and userinfo before it travels.
Also: route the one transient retry through the same watcher (a retry is
if anything more likely to meet a dead transport — the exact failure this
branch exists to stop reporting as a timeout), and skip materializing a
config that holds no ``${secret:...}`` references at all. The latter is
worth it: ``_signature`` runs per live connection on every reload, which
``ensure_scope`` performs once per turn, and resolving does per-reference
mkdir + chmod + read synchronously on that path.
---------
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: NoxsMedia <155662416+NoxsMedia@users.noreply.github.com>
Co-authored-by: 0xTidalBore <142905837+0xTidalBore@users.noreply.github.com>
Co-authored-by: 0xtidalbore <ahmed@itcloud.ca>
Per-account MCP Services and CLI Apps — the two ways a deployment plugs in
tools DeepTutor never shipped — plus the isolation that makes them safe on a
shared install.
- MCP Services: a 45-entry curated store of hosted servers each account
installs for itself, OAuth 2.1 (PKCE + dynamic client registration) for the
servers that require it, static keys held by reference and resolved in memory
at connect time, stdio refused for self-service. Settings no longer
configures MCP; /settings/mcp redirects to the store.
- CLI Apps: 101 tools snapshotted from the two CLI-Anything registries.
Installs are admin-only, the registry's install_cmd is parsed into an argv we
build rather than executed, npm install scripts are forced off, and 66
first-party entries are pinned to one reviewed commit. Apps land in
data/cli-apps, one environment each, mounted read-only into the runner.
- Credentials that authorise a person move to data/system, the one branch the
exec sandbox never mounts: Codex tokens relocate themselves on first use
(refusing to follow a symlink), per-user MCP configs and keys land beside
them.
- Grants gain a cli_apps whitelist with the same deny-by-default posture as
MCP tools; a per-turn registry view keeps one owner's provider tools out of
the process-global registry and refuses an unauthorised tool at execute, not
just in the manifest.
- The composer reports what filled this turn's context window, a gutter rail
jumps back through long conversations, and the workspace collapses to a
drawer on small screens.
- The composer keeps focus after sending and across tab switches (#720);
released images carry provenance and SBOM attestations (#722).
README prose, all ten translated READMEs, and the docs-site pages that named
Settings → MCP are updated to match. Release notes:
assets/releases/ver1-5-7.md
PageIndex deprecated its REST retrieval endpoint; deep retrieval is now
agentic through the hosted PageIndex MCP server, while search() serves
programmatic callers with real document tree outlines.
- New built-in "pageindex" MCP server entry, code-injected at manager load
when an API key is configured (never persisted to mcp.json; user-defined
entry wins; hot-reloads on key change). remove_document is blocked via a
new MCPServerConfig.disabled_tools blocklist.
- Chat turns with a PageIndex KB attached get the server's tools preloaded
under a narrowed implicit grant (KB access = permission), plus a system
prompt block listing the KB's file -> doc_id manifest with usage notes.
The rag tool's kb_name enum excludes PageIndex KBs (a pure-PageIndex
conversation doesn't mount rag), so the agent reads those docs via MCP.
- PageIndexPipeline.search() now returns each document's tree outline
(titles / pages / summaries) fetched over REST (GET /doc/{id}/?summary=true)
as honest structural context for programmatic callers (book, co-writer,
seed, CLI). No new error_type; existing not_configured / retrieval_error /
needs_reindex semantics are unchanged. The dead REST retrieval client
methods are deleted. Existing KBs need no migration.
- SUPPORTED_EXTENSIONS now mirrors POST /doc/: pdf, md, markdown, txt, docx,
doc, pptx, ppt, xlsx, xls, csv (zip stays a local container); frontend
format list + copy updated (en/zh).