Skip to main content

splent_feature_mcp

The product as a Model Context Protocol server. An assistant that speaks MCP (Claude, for example) connects to /mcp with an API token of splent_feature_apikeys and uses the tools the other features of the product declare, each as the account the token belongs to: it sees what that person sees on the site, and nothing else.

The feature holds no tool of its own. A tool belongs to the feature whose domain it reaches, the way an apikeys scope belongs to the feature whose routes check it.

Declaring tools in a feature

A feature declares its tools as data in <feature>/mcp_tools.py, a module that imports nothing from this feature, so the feature does not depend on it and the UVL model needs no constraint for it:

from flask_babel import lazy_gettext as _l


def free_rooms(user, day):
    if not day:
        raise ValueError("Say which day.")
    return {"day": day, "rooms": ["A", "B"]}


MCP_TOOLS = [
    {
        "name": "rooms_free",
        "title": _l("Free rooms"),
        "description": "The rooms free on a day.",
        "input_schema": {
            "type": "object",
            "properties": {"day": {"type": "string", "description": "YYYY-MM-DD"}},
            "required": ["day"],
            "additionalProperties": False,
        },
        "scope": "rooms:read",
        "scope_label": _l("See the rooms and their bookings"),
        "read_only": True,
        "handler": free_rooms,
    },
]
  • name: 1 to 64 letters, digits, _ or -. Prefix it with the feature's name, so two features never claim the same one.
  • description: what the assistant reads to decide when to call it. Plain English, precise about units, formats and time zones.
  • input_schema: a JSON Schema object. The server checks what the tools here need of it before calling the handler: required properties, the type of each (an integer is never a boolean), enum, minimum, maximum, and unknown properties when additionalProperties is false.
  • handler(user, **arguments): called with the token's account and the arguments by name. It answers something JSON can carry; a dict also goes to the client as structured content. It raises ValueError with a message for the person to refuse what it was asked, and the assistant gets it as a tool error. Any other exception is logged and answered as a failure of the tool, without its details.
  • scope: what the token has to carry. It is registered with apikeys from scope_label when the tool is found, so the token form offers it. A tool that only reads (read_only true, the default) registers a default scope. One that changes things registers a scope that writes, which a token only gets when someone asks for it, and which only an account that may act sensitively is granted; mark it destructive when it deletes or undoes, so the client asks before calling it.

The tools are found once per app, at its first request, among the features that registered a blueprint. registry.register_mcp_tool declares one from code, for a feature that does depend on this one.

The endpoint

POST /mcp: JSON-RPC 2.0 over Streamable HTTP, answered as plain JSON in the body of the same response. The server keeps no session and opens no stream, so GET and DELETE are 405, and any worker of any process answers any request. It answers initialize (protocol revisions 2025-06-18, 2025-03-26 and 2024-11-05), ping, tools/list and tools/call, and accepts any notification with 202.

  • Every request carries Authorization: Bearer <token>. Without a usable token the answer is apikeys' refusal, 401 or 403, with a WWW-Authenticate: Bearer challenge.
  • A token lists and calls only the tools whose scope it carries.
  • A request with an Origin header from another host is refused (403), so a page of another site cannot reach the endpoint through a visitor's network.

/mcp/connect, in the Developer section of the menu, tells a person how to connect an assistant: the address, the token to create, the command for Claude Code, and the tools the site offers.

claude mcp add --transport http <product>-mcp https://<host>/mcp \
  --header "Authorization: Bearer <token>"

Configuration

Variable Default Meaning
MCP_TOOLS empty The tools offered, comma separated. Empty offers every tool declared
MCP_SERVER_NAME empty The name the server gives itself. Empty is <SPLENT_APP>-mcp
MCP_INSTRUCTIONS empty What the server tells the assistant when it connects

A product that narrows apikeys' offer with APIKEYS_SCOPES lists the scopes of the tools it wants to offer there too.

Requires

auth and apikeys.

Metadata

Release files for splent-feature-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for splent-feature-mcp 0.1.0
File Size Uploaded Provenance Actions
splent_feature_mcp-0.1.0.tar.gz 29.4 kB Without provenance Details for splent_feature_mcp-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for splent-feature-mcp 0.1.0
File Interpreter ABI Platform Actions
splent_feature_mcp-0.1.0-py3-none-any.whl Python 3 none any Details for splent_feature_mcp-0.1.0-py3-none-any.whl

Total release size: 63.4 kB

Release files / splent_feature_mcp-0.1.0.tar.gz

Download URL splent_feature_mcp-0.1.0.tar.gz
Size 29.4 kB
Tags Source
SHA-256 checksum
How to use checksums
bc9c9ce5616437a2038b8aeabcc49d3abfedd78b1ce67a5fe5ada15bcf5d2d27
BLAKE2b-256 checksum
How to use checksums
872fb6e00c0428bb276ffc7bb7463cd66d28bc4894f6f16de2b70943a1ab57ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.16

Release files / splent_feature_mcp-0.1.0-py3-none-any.whl

Download URL splent_feature_mcp-0.1.0-py3-none-any.whl
Size 34.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6248235c44a2944abd7b4f96c6e27ba893e87c3785b631d0bcc1e03b23f11d2b
BLAKE2b-256 checksum
How to use checksums
b74fbe7aafe6bd7b853145e6009476e2bacfb2b798131f58f00235d99dbeaace
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.16

Security for splent-feature-mcp 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page