Boundary by OraXLabs · Report revision 1 · 24 Nov 2026
LangChain MCP
tool metadata and approval.
A bounded review of URL-target validation, tool metadata and a destructive-tool approval example. The selected source demonstrates useful controls. The recommendation is documentation hardening: make the trusted-catalog assumption explicit, without treating optional server hints as application authorization.
Independent educational source review, not commissioned or endorsed by LangChain. No verified vulnerability, approval bypass, real deletion or deployed impact was established.
Executive decision
Keep the adapter’s explicit target validation. When adapting the approval example, state which server catalog the application trusts and use application-owned policy for consequential actions. Consider requiring approval for unknown tools instead of inferring permission from absent annotations.
- Verified vulnerabilities
- 0
- Observed controls
- 1 · LC-1
- Documentation-hardening observations
- 1 · LC-2
- Executed tests
- 0
- Remediation status
- Not rechecked · No established defect fixed
Scope and method
Read-only inspection of public source at 4af34be7bee448ef32ea4f100b61e6df09a74cf6, on November 24, 2026. Public repository metadata was checked before implementation reads.
Selected code: the current MCP adapter, tool wrapper, destructive-interrupt example and its controlled server fixture; accompanying README and package manifest supplied context. The manifest declares 1.5.2 and an optional fastmcp>=4.0.11 dependency. Examples document the MCP extra and their entry points.
This is current source, not proof of released wheel equality, lock-resolved installation, successful build or deployment. No code import, installation, tool/model/provider request, process execution, network test or real filesystem operation was performed. Approval middleware, elicitation, credential getters and dependency internals remain unreviewed.
Selected source
- libs/langchain_v1/langchain/mcp/adapter.py
- libs/langchain_v1/langchain/mcp/tools.py
- libs/langchain_v1/examples/mcp/destructive_interrupt.py
- libs/langchain_v1/examples/mcp/README.md
- libs/langchain_v1/pyproject.toml
- libs/langchain_v1/examples/mcp/_servers.py
Observations at a glance
- LC-1 · Existing control
- Bare-string targets are constrained to HTTP/HTTPS URLs. No defect established; severity not applicable.
- LC-2 · Documentation hardening
- Clarify trusted-catalog assumptions when using metadata to select approval gates. Not a verified vulnerability; no product severity assigned.
LC-1 · Observed control
Bare-string targets have an explicit URL check
Bare strings must validate as HTTP/HTTPS URLs before FastMCP construction. Explicit local target types remain intentional caller authority.
Evidence
adapter.py:83 · _validate_url_target and MCPAdapter.__init__:173.
Conditions and limits
No local-execution vulnerability claimed from explicit Path/config; no process execution or target validation testing conducted.
Explicit local target types are deliberate caller choices, not evidence that an untrusted string executes locally. Dependency transport internals and authentication behavior were outside this review.
Recommendation and verification criterion
Preserve validation before client construction. In an authorized integration, test the intended URL and explicitly local target forms without granting untrusted metadata the application’s target-selection authority.
Status: Not rechecked. Static source reading only; target validation was not executed.
LC-2 · Documentation hardening
Tool hints need a stated trust boundary
Adapter forwards optional server annotations into tool metadata. Approval sample uses destructive_hint with false fallback to decide gated tool names.
Meaning and conditions
If a downstream application adopts that example as the sole approval policy for a less-trusted or incompletely annotated catalog, the classification depends on server claims. Such an application/configuration was not observed or tested.
Optional tool annotations describe a server’s claims. A downstream application should explicitly decide whether those claims are sufficient for its approval policy, or require separate application-owned rules.
Evidence
- libs/langchain_v1/langchain/mcp/tools.py:183 · _tool_metadata
- libs/langchain_v1/examples/mcp/destructive_interrupt.py:34 · _is_destructive
- libs/langchain_v1/examples/mcp/destructive_interrupt.py:46 · main
- libs/langchain_v1/examples/mcp/_servers.py:58 · files_server / delete_file
Counterevidence
Exact bundled sample constructs its own controlled in-memory server. delete_file explicitly advertises destructiveHint true and only returns a demonstration string. No normal-example gate failure, unauthorized caller, actual deletion or running-system impact established.
This sample therefore does not establish a gate failure in the bundled example. It does not prove missing application permissions, unsafe model execution, data loss or an issue in a deployed customer application.
Recommendation and verification criterion
Add explicit trusted-server prerequisite; advise application-owned policy or default approval for unknown tools rather than relying on server hints as authorization.
For an authorized downstream integration, document catalog ownership and policy inputs, then verify that an unknown or incompletely annotated tool receives the intended approval decision. Test the application’s complete approval mechanism before claiming enforcement.
Status: Not rechecked. No documentation patch, approval-middleware audit or executed regression check was performed.
Priorities and closure
- For LC-2, explain the example’s controlled-server assumption where the approval rule is introduced.
- Before adapting it to a different catalog, define the application’s own approval policy, including unknown tools.
- For LC-1, retain target validation and verify the actual integration within its authorized scope.
No verified reportable security finding was established. This report records source evidence and a bounded documentation recommendation; it is not a new CVE, a fixed security issue or a certification. No claim about maintainer response or acceptance is made.
Source identity
The checksums identify the selected public bytes, not installed artifacts or runtime behavior.
- libs/langchain_v1/langchain/mcp/adapter.py
3931e615150df432b32f8ee78ea8c67c490823b268e68d4176357d535c30fdaa- libs/langchain_v1/langchain/mcp/tools.py
42785c07495f50236189aee68e616857d6060aa241e4709a89c5e9ed135fbaec- libs/langchain_v1/examples/mcp/destructive_interrupt.py
7d66124629cbb9b317bb42f514d9745392a57b7bb5f5053bd389a1c7ea872894- libs/langchain_v1/examples/mcp/README.md
6d2ff77b1374391f7f3de5a89b5cb75fc6662765a2695231917323f264f643d3- libs/langchain_v1/pyproject.toml
eeac3f609ef7955ed2b61d035b0862aba3bfabc01a6ef9fb1c8809b40817b5a9- libs/langchain_v1/examples/mcp/_servers.py
f9befa3b522d88daaf2228e43c4f253b38460c62a7e2e803ad66adb99c1ec075