ragleap-integrations
version — loading live from PyPI…
An MCP (Model Context Protocol) client that turns allowlisted tools on remote MCP servers into ragleap-tools Tool objects, so MCP tools and native tools share one shape. Since 0.4.0 it is also a UTCP (Universal Tool Calling Protocol) client for http manuals; its discovery was live-checked against a real manual on 2026-11-07 (0.4.0) and again on 2026-11-12 (0.5.0, no credential), but no tool call has been verified against a real UTCP server.
pip install ragleap-integrations
Highlights
- The owner configures the servers and an exact
server.toolallowlist; the model supplies only a tool's JSON arguments, never a URL, a token or a tool outside the allowlist - MCP over Streamable HTTP only. The tool list is snapshotted once at setup, so a server that changes a description later has no effect
- Bounded network access in code: https only, no credentials in the URL, no IP-literal hosts, DNS resolved once with every address required to be public, TLS 1.2 or newer verified against the hostname, no redirects, a response-size cap and a wall-clock deadline
- Server error text is never put in a result, and owners can supply their own tool descriptions and schemas to keep server text out of the model's context
- New in 0.5.0 (from its changelog, 2026-11-11):
allowed_queryonUtcpServerConfigandconnect_utcp: the owner lists the static query parameter names a tool URL may carry (at most 8 names, each 1 to 32 of letters, digits,_,.,-, all distinct). The default is empty, exactly the 0.4.0 behavior. Each pair in the URL must bename=valuewith a value of 1 to 64 of letters, digits,_,.,-; a repeated name, a name that is also an input property and any placeholder are refused, and an argument named like a static parameter is refused at call time with nothing sent. Oneauthshape is now accepted: an api_key in the Authorization header with the value exactlyBearer ${NAME}, because it describes what this client already does (the owner’s token as a bearer token to approved origins).NAMEis never looked up, and without a token the tool is skipped. Any other auth block is skipped as in 0.4.0. A tool URL ending in a bare?is now skipped (0.4.0 accepted it and sent.../o??x=1). - New in 0.4.0 (
connect_utcp, a UTCP client): reads one UTCP (Universal Tool Calling Protocol) manual once and offers only its allowlistedhttptools, with an exact allowlist, approved origins checked at discovery and on every call, no variable substitution or environment lookup, the owner’s token sent only to approved origins, and the same approval hook, audit events (markedutcp) and constant error texts as the MCP client. The bounded HTTPS transport now supports GET, POST, PUT, DELETE and PATCH. Code that does not useconnect_utcpbehaves as in 0.3.0, per the changelog - New in 0.3.0 (
McpHub, multi-tenant use): one owner-level config and oneConnectionperScope(tenant and subject), each with its own client, tool snapshot and token. The scope is closed over by the tool handlers: it is never a tool argument and the model never sees or sets it.token_provider(scope, server)is called for every request and nothing is cached;allow_for(scope)can only narrow the owner’s allowlist;policy_for(scope)andapprove_scopedgive per-tenant approval;RateLimitis per tenant; events carry the tenant and scope but never arguments or results. Code that does not useMcpHubbehaves as in 0.2.0, per the changelog - New in 0.2.0:
connect(url, allow=[...])goes from a URL to ready tools in one call, and server tool hints are treated as untrusted: every tool is flagged for approval unless you pre-approve it, an optionalapprovehook can block flagged calls, and anon_eventhook reports one audit event per discovery and per call, never with arguments or results
Tech stack
Python 3.10 to 3.12. One dependency: ragleap-tools>=0.5.1. Optional extra security (since 0.3.0): ragleap-security>=0.1.0. Test extra: pytest>=8.0.0 (and, since 0.3.0, ragleap-security>=0.1.0). MIT licensed.
Testing
303 test functions across 9 test files, verified directly from the repo (parametrised cases count once).
Verification status
- Live-checked on 2026-10-05 against DeepWiki's public MCP server: the client fell back to the legacy handshake, listed tools and read a repository's documentation structure.
- Live-checked on 2026-10-12 against two public Google Cloud MCP endpoints on the modern 2026-07-28 path (discovery only: read-only, no credentials, no
tools/call, using the published 0.1.0 wheel). The server accepted the modern request, the client recorded the modern era, the reply was plainapplication/json(non-stream), and the client discovered 3 tools with their input schemas from one server. A 15-tool server's 359,293-byte tool list exceeded the old 256 KiB default and failed discovery until the cap was raised; 0.1.1 raises the default to 1 MiB. - Live-checked on 2026-10-17 (0.1.1) and again on 2026-10-24 (the published 0.2.0 wheel) against a third party's public mock MCP servers (mcpplaygroundonline.com; their own description of each server is not independently verified): modern
tools/callsucceeded (pinned and unpinned), bearer-token authentication worked (HTTP 401 without a token, success with a fresh one) and the legacy fallback worked. - Not live-verified, covered by tests against fakes only:
x-mcp-headermirroring (none of the four tools checked carries it), pagination (neither server paginated) and this client's handling of a live-32022reply (a raw request got HTTP 400 with the supported versions inerror.data.supported, where the client looks). Treat these as best-effort until confirmed live. - New in 0.2.0, live-checked on 2026-10-25 against Google Cloud's Pub/Sub MCP endpoint (
tools/listonly, no credentials):connect()discovery, the annotation parsing and the approval flags matched an independent calculation from the real hints. Not live-verified: theapprovehook, its denial text and the per-call audit events, which have only been run against fake servers. - New in 0.3.0, live-checked on 2026-10-26 with the repository source of the 0.3.0 branch against a third party’s public mock MCP auth server (mcpplaygroundonline.com; its own description is not independently verified), read-only: two tenants each discovered and called one tool with their own token, and all four recorded requests carried only that tenant’s token (compared by hash); a made-up token was refused with HTTP 401 while the real tenants kept working; after one tenant’s token was changed that tenant got 401 and the other was unaffected;
RateLimit(2, 60)allowed two calls and denied the third locally, and twotools/callrequests reached the server; nine events all carried a tenant and none a token. The limit of this check: the mock server cannot tell tenants apart, so separation is shown from the requests that were sent, not from the server separating data. Not live-verified (per the 0.3.0 changelog):approve_scoped,allow_forandpolicy_foragainst a real server, a realragleap_security.AuditLogfed by a live run, concurrent tenants against a real server, and a server that really separates tenants’ data. Live-checked again on 2026-10-27 with the published 0.3.0 wheel (wheel hash starting 2b828b015267): the same six checks all passed, with the same limit that the mock server cannot tell tenants apart. (Correction, 2026-10-30: the list above, taken from the 0.3.0 changelog, named the published wheel as not live-verified; it was checked on 2026-10-27, and the changelog shipped inside the release cannot be edited.) - New in 0.4.0 (the UTCP client,
connect_utcp), no tool call verified against a real UTCP server: every call was tested against a recording fake transport and, for the new transport methods, a local TLS server with a throwaway certificate. Discovery was live-checked after release, on 2026-11-07, against Unified.to’s public UTCP manual (two GET requests, no credential, no tool call): HTTP 200, 237,586 bytes,utcp_version1.0.1, 33 tools, allhttp;connect_utcpoffered none of the 20 tools tried, because every one declaresauth, which 0.4.0 does not support. 545 tests (the 331 earlier ones unchanged plus 184 for the UTCP client and 30 for the transport methods) passed on Python 3.10 and 3.12 (541 passed and 4 skipped withoutragleap-security), and 127 of 127 deliberate breaks of the new code were caught (plus one documented equivalent mutant). After release the published wheel was byte-identical to the TestPyPI wheel, the installed files equalled the source,pip checkwas clean with and without the extra and a smoke test passed. - New in 0.5.0, from its changelog (not run by us): 626 tests pass in the development sandbox (the 545 of 0.4.0 unchanged plus 81 new), and 48 of 52 deliberate breaks of the new code are caught; the other 4 are equivalent mutants, where another check on the same path gives the same outcome. The changelog also records that the public manual at api.unified.to/utcp was read on 2026-11-07, 2026-11-08 and 2026-11-09 (counts and shapes only: 33, 35 and 37 tools, no credential and no tool call), and corrects the 0.4.0 statement that no manual in the current format was found: one was found after 2026-11-07.
- Observed by us, 2026-11-12 (01:35 UTC), with the published 0.5.0 wheel: two GET requests to Unified.to’s public manual, no token, no tool call. HTTP 200, 323,907 bytes, 37 tools, all
http. 0 of the 20 tools tried were offered; all 20 were skipped with the reason “the template declares auth but no token is configured”, which the client reaches only after the exact auth-shape check (read in code). Not reached: the query rule and any call with a token (no credential was used). The manual changes daily, so these numbers are point-in-time. - Not verified (per the 0.4.0 changelog): any call against a real UTCP server, the normative text of the UTCP specification, its auth types, and whether the reference clients restrict hosts or substitute placeholders from a manual; only the project’s documentation and reference clients were read.
scripts/utcp_live.py, the read-only discovery check used on 2026-11-07, is in the repository. - Release date of 0.4.0: its changelog heading says 2026-11-04, but the files reached PyPI on 2026-11-05 (UTC) and the TestPyPI sdist carries 2026-11-03. Published files cannot be edited, so this correction is recorded here, on the wiki and on the packages site.
Limits to know about
- This package does not screen server text (descriptions, schemas, results) for prompt injection. The structural limits are the allowlist, the one-time tool snapshot, length caps and optional owner-supplied specs.
- New in 0.3.0 (from its README): this package does not decide who the caller is, so tenant isolation is only as strong as the
Scopeyou pass and the token yourtoken_providerreturns. Rate windows are kept per tenant untilhub.forget(tenant=...), the limit is per process, andallow_forandpolicy_forare read once per scope. - New in 0.4.0 (from its changelog):
connect_utcp(url, *, allow, ...)reads one UTCP manual once and returns its allowlistedhttptools as aConnection. The allowlist is exact (no wildcard), and approved origins are checked at discovery and on every call - New in 0.5.0 (from its changelog): not verified are any tool call against a real UTCP server (discovery only was observed), the normative text of the UTCP specification (not read), and whether a vendor returns the same manual when a bearer token is sent. Not supported: other auth types (basic, OAuth2, other api_key shapes),
header_fields, OpenAPI conversion, variable substitution and a multi-tenant UTCP hub; tools whose input schema exceedsmax_schema_charsare still skipped. - Not supported by the MCP client in v0.4.0 (the 0.4.0 changelog records no change to this list; updated 2026-11-07: this line said “Not supported in v0.3.0”; updated 2026-10-30: it had said “Not supported in v0.2.0”): stdio, the deprecated HTTP+SSE transport, sampling, elicitation, roots, resources, prompts, subscriptions and OAuth. UTCP (0.4.0): only
httpcall templates; noauthblocks,header_fields, OAuth, OpenAPI conversion or multi-tenant hub (UtcpHub) yet. Updated 2026-11-14: 0.5.0 accepts oneauthshape (see the 0.5.0 line above); the rest of this UTCP list is unchanged. - The approval flag is advice unless you supply an
approvehook, and a server's own hints are not a security boundary. - It is not a tool-calling loop; that is left to your own agent code.
- The UTCP client (0.4.0) returns the response body text, capped at
max_result_chars; it is not parsed or validated against the manual’s output schema. - A UTCP server’s description, schema and reply text is untrusted and, like MCP server text, is not screened for prompt injection.
- Not safe to share one
UtcpClientbetween threads while calls are running. - Unified.to’s public manual (checked 2026-11-07) declares
authon every tool tried, so 0.4.0 offers none of its tools; supporting auth blocks would need its own design pass. Updated 2026-11-14: 0.5.0 accepts one auth shape; a read with the published 0.5.0 wheel on 2026-11-12 (no token) still offered none of the tools tried, because all were skipped for lack of a configured token (see Verification status).
Quickstart
from ragleap_integrations import McpConfig, McpServerConfig, make_mcp_tools
config = McpConfig(
servers=[McpServerConfig("deepwiki", "https://mcp.deepwiki.com/mcp")], # token="..." if a server needs one
allowed_tools=["deepwiki.read_wiki_structure"],
)
tools = make_mcp_tools(config) # discovers the allowlisted tools once (tools/list)
openai_tools = [t.to_openai_schema() for t in tools] # or t.to_gemini_schema()
result = tools[0].call(repoName="sqlite/sqlite")
print(result.success, result.result) # True {"text": "..."}