Repository navigation
Releases
v0.4.0
0.4.0 lets a server talk to its client while a request is running.
pip install -U easy-mcp-kitNew
- Progress updates.
report_progress(done, total, message)from any tool, resource or prompt. Throttled to one notification per 0.1 s, the last one always sent before the answer. - Ask the user a question.
elicit("For how many people?", {"guests": int})shows a form in the client and returns the answer. One tool works with stateless (2026-07-28) clients and with sessions. - Browser clients.
allowed_originsis now the CORS policy too: preflights are answered and answers are readable by pages on the origins you list. - Icons.
icons=on the server and on tools, resources and prompts.Icon.from_file("logo.png")embeds a small image. - Paged tool list.
tools/listreturns 100 tools per page withnextCursor.
from typing import Literal
from easy_mcp import MCPServer, elicit, report_progress
server = MCPServer(allowed_origins=["https://app.example.com"])
@server.tool
def book_table(restaurant: str) -> str:
"""Book a table."""
answer = elicit("For how many, and when?",
{"guests": int, "day": Literal["today", "tomorrow"]})
if not answer.accepted:
return "Nothing was booked."
report_progress(1, total=2, message="Checking availability")
...
return f"Booked {restaurant} for {answer['guests']}, {answer['day']}."Good to know before upgrading
- A page on a loopback origin (allowed by default) can now call a local server and read the answers. Pass
allowed_origins=[]to let no browser page in. - A server with more than 100 tools needs a client that follows
nextCursor. - A tool that calls
elicit()runs again from the top once the answer is in: ask first, act afterwards. - With several workers and tools that call
elicit(), setEASY_MCP_STATE_SECRETto the same value in every worker.
The README's Upgrading from 0.3.2 has the full list, and the CHANGELOG the details.
Left out on purpose
The 2026-07-28 specification deprecates sampling and removes resumable SSE streams, so 0.4.0 implements neither.
Checked against
The official MCP Python SDK client 2.3 in auto, 2026-07-28 and legacy modes, over Streamable HTTP and stdio.
What's Changed
- Keep a cancelled test call's audit event out of the next test by @Mark007-R in #54
- Replace the demo video and code snapshots for 0.3.2 by @Mark007-R in #55
- Progress updates: report_progress() by @Mark007-R in #56
- CORS for browser-based clients by @Mark007-R in #57
- Paginate tools/list by @Mark007-R in #58
- Icons for the server, tools, resources and prompts by @Mark007-R in #59
- Ask the user a question from a tool: elicit() by @Mark007-R in #60
- Release 0.4.0 by @Mark007-R in #61
Full Changelog: v0.3.2...v0.4.0
v0.3.2
easy-mcp-kit 0.3.2 completes the v0.3 milestone: six features that take a server from "tools over HTTP" to something you can run in production with several workers.
What's new
- Resources, prompts and completion:
@server.resource("scheme://{var}")and@server.prompt, with argument completion, pagination, cache hints andsafe_path(). Both protocol eras are supported (#51). - Live lists: registering a tool, resource or prompt at runtime tells connected clients. This works over stdio, SSE and the
GET /mcpstream, and throughsubscriptions/listenfor stateless 2026-07-28 clients. Resource updates go throughnotify_resource_updated()(#50, #51). - Middleware:
@server.middlewarearound every request and@server.tool_middlewarearound a tool's execution. They run after the built-in checks and cannot skip them (#47). - OAuth 2.1 bearer tokens: the server becomes an OAuth resource server, with JWT or introspection, scopes, step-up and protected-resource metadata, next to API keys (#48).
- Shared session store:
RedisStorelets several workers share sessions, call caps, rate limits and cancellation (#49). - Traces and metrics: OpenTelemetry
SERVERspans per message (new[otel]extra), and Prometheus text atGET /metricswith no extra dependency (#52).
Upgrading
See "Upgrading from 0.3.1" in the README for every visible change and what to do about it, and CHANGELOG.md for the full list.
pip install -U "easy-mcp-kit[redis,otel,oauth]"What's Changed
- SECURITY: list 0.3.x as the supported line by @Mark007-R in #45
- Record the demo video and code snapshots for 0.3.1 by @Mark007-R in #46
- Add request and tool middleware by @Mark007-R in #47
- Verify OAuth 2.1 bearer tokens per the MCP authorization spec by @Mark007-R in #48
- Share sessions between workers through a pluggable store (Redis) by @Mark007-R in #49
- List-changed notifications and subscriptions/listen by @Mark007-R in #50
- Resources, prompts and completion by @Mark007-R in #51
- OpenTelemetry tracing and Prometheus metrics by @Mark007-R in #52
- Release 0.3.2 by @Mark007-R in #53
Full Changelog: v0.3.1...v0.3.2
v0.3.1
Cancelling a tool call now stops its query on the database, not just the answer.
pip install -U easy-mcp-kitThe problem
When a client cancelled a call, or the server's tool timeout fired, the server stopped waiting and dropped the response. The query kept running on the database until the connector's own statement deadline, because sync tools ran in a worker thread that nothing could stop.
Cancellation reaches sync tools
- A cancel token for every call. Inside a tool,
easy_mcp.current_cancel_token()returns it. It is triggered bynotifications/cancelled, a closed stateless connection, a deleted session, stdio shutdown, and the tool timeout. - Callbacks. Register with
token.on_cancel(...), or polltoken.cancelled/token.reason. Callbacks run on a thread of their own, off the event loop. A failing callback is logged and audited ascancel_callback_failed. - At shutdown, the transports give tool threads and cancel callbacks a bounded time to finish (stdio's
shutdown_timeout, 5 s over HTTP/SSE), so aKILL QUERYgets out before the process exits. If you drivedispatchyourself, callawait server.wait_for_tool_threads(5)before exiting. - Tools that ignore the token behave as before, apart from the thread changes below.
The connectors stop the statement
| Connector | On cancel or timeout |
|---|---|
| MySQL / MariaDB | KILL QUERY at once, not only at the deadline |
| Postgres | a cancel request (cancel_safe on psycopg 3.2+, cancel on 3.1) |
| SQLite | interrupt(); the progress handler also catches a cancel just before a statement starts |
| MongoDB | each call runs in its own session, ended with killSessions (the read role is enough). It reaches the primary only, and calls the deployment refuses a session run without one, as in 0.3.0 |
| GitHub | no request is sent once a call is cancelled. A write already sent may still complete, and the audit log records it as tool_finished_after_cancel |
Live-tested against MySQL 8.4, Postgres 16 and MongoDB 7 with least-privilege accounts (SELECT-only, a plain login role, read), on Windows and on Linux with Python 3.12 and 3.14. After a cancel, the query is gone from PROCESSLIST / pg_stat_activity / $currentOp within 1.5 s. That includes a stdio client that quits mid-query. On 0.3.0 the same tests show the query still running.
Changes to know about when upgrading
- Sync tools run on a daemon thread each, capped by
max_sync_workers(default 32, shared by all clients). A call beyond the cap is refused at once withServerBusyError(-32008). 0.3.0 queued it, so retry refused calls after a short delay. - Threads a sync tool starts are daemons too, because Python threads inherit the flag. They are stopped at exit, where 0.3.0 waited for them. Pass
daemon=Falseor use aThreadPoolExecutorfor work that must outlive the call. - A
TimeoutErrorraised by a tool itself, such as a socket read, is reported as a tool failure instead of the server's-32005. server.run()shuts down with SSE clients connected. It closes open legacy SSE streams first; before, Ctrl-C hung until a second one forced the exit. If you mountbuild_app()in another app, callwait_for_tool_threadsfrom its shutdown.- MongoDB
database_factorytest doubles should acceptsession=. A double withoutstart_sessionstill works, without the kill. - Startup warning. The connectors warn when
default_timeoutis not longer than their statement timeout.
Full details are in CHANGELOG.md.
What's Changed
- Record the demo video and code snapshots for 0.3.0 by @Mark007-R in #41
- Stop the database query when a tool call is cancelled by @Mark007-R in #42
- Fix cancellation issues found in pre-release review by @Mark007-R in #43
- Release 0.3.1 by @Mark007-R in #44
Full Changelog: v0.3.0...v0.3.1
v0.3.0
The first v0.3 release: the stateless MCP revision, and three new read-only database connectors.
pip install easy-mcp-kit # SQLite needs nothing more
pip install "easy-mcp-kit[mysql]" # MySQL / MariaDB
pip install "easy-mcp-kit[mongodb]" # MongoDBStateless MCP 2026-07-28
Served next to the initialize era on every transport, with nothing to configure. The era is chosen per request, so old and new clients share one server.
- No handshake, no session. Each request carries its protocol version and client capabilities in
_meta. - Discovery.
server/discoverreports the supported versions, capabilities and instructions. Results carryresultType, the server's identity, andttlMs/cacheScopecache hints. - HTTP header checks. The
MCP-Protocol-Version,Mcp-MethodandMcp-Nameheaders must each appear once and match the body (400/-32020otherwise), because a proxy may route on them. - Cancellation. Closing the connection cancels the call.
- Verified with the official Python SDK 2.2 client in its auto, pinned and legacy modes, over HTTP and stdio.
New connectors
All three are read-only by construction, time-limited and row-capped. Each was live-tested against a real server with deliberately over-privileged accounts.
easy-mcp-sqlite. Needs no extra and no server; point it at a database file. The file is opened read-only, and an authorizer admits only reads, so writes, schema changes andATTACHto other files are refused.easy-mcp-mysql. Every statement runs in a rolled-backREAD ONLYtransaction, plus a check that admits only reading statements. Testing showed a read-only transaction still lets a privileged account runSET GLOBALorSELECT ... INTO OUTFILE.KILL QUERYenforces the time limit on every statement type.easy-mcp-mongodb. Only read operations are offered. Aggregation stages come from a reading allow-list checked through nested pipelines, so$outand$mergeare refused and no stage can reach another database. Server-side JavaScript is refused, and values travel as Extended JSON both ways.
Also
- A
tools/callsent without anidno longer runs the tool, on any transport.
Full details are in CHANGELOG.md.
What's Changed
- Re-record the demo video against 0.2.5 by @Mark007-R in #35
- ci: add HOL AI plugin scanner workflow by @Mark007-R in #38
- docs: add plugin scanner badge to README by @Mark007-R in #39
- Stateless MCP 2026-07-28 and a read-only SQLite connector by @Mark007-R in #36
- Add read-only MySQL and MongoDB connectors by @Mark007-R in #37
- Release 0.3.0 by @Mark007-R in #40
Full Changelog: v0.2.5...v0.3.0
v0.2.5
A patch release, so that the easy-mcp run command added in 0.2.4 actually has a working invocation.
Fixed
python -m easy_mcpandpython -m easy_mcp.clinow run the command.cli.pyshipped without a__main__guard, sopython -m easy_mcp.cliimported the module and exited without serving anything — printing nothing and returning 0, which leaves a client that spawned it seeing only a closed connection.
Why this matters beyond tidiness: the easy-mcp command is a generated .exe on Windows, and application-control policies refuse to launch one out of a freshly created virtualenv (WinError 4551). With the launcher blocked and python -m a silent no-op, 0.2.4 had no working way to start its own CLI on such a machine. Both halves were hit for real while recording the 0.2.4 demo. The ready-made connectors already supported python -m; the new CLI now matches them.
No API changes — 0.2.4 code behaves identically.
pip install easy-mcp-kit==0.2.5
python -m easy_mcp run my_tools:serverv0.2.4
Closes the v0.2 milestone: richer schemas on both sides of a tool call, and a way to launch a server without writing a __main__ block.
Added
- Parameter descriptions from
Annotated[T, "description"], alongside the docstring'sArgs:section. The annotation sits next to the parameter, so it cannot quietly stop applying when the parameter is renamed. Where both exist, the annotation wins. - Structured results. A tool whose return annotation describes a JSON object now publishes an
outputSchemaintools/listand answers withstructuredContentnext to the text block the spec keeps for older clients. Results are validated against the schema before they are sent. - Optional Pydantic v2 models as whole parameters and return types, via the new
easy-mcp-kit[pydantic]extra. The model's own schema is advertised — constraints included — and Pydantic does the validating, so every violation is reported rather than the first. The library never imports Pydantic; models are recognised by duck typing. easy-mcp run my_tools:server, which imports a module and serves the server it defines.--transportpicks stdio or HTTP per host;--host,--portand--debugoverride the module's own settings only when given.
Fixed
- An
Annotatedparameter's description no longer vanishes from the generated schema.get_type_hints()strips annotation metadata unless asked not to, so the text was silently dropped and clients saw an undocumented parameter.
Everything is backwards compatible: a tool written against 0.1 registers and behaves exactly as before. Full detail in CHANGELOG.md.
pip install easy-mcp-kit==0.2.4What's Changed
- Refresh the demo video and code snapshots for 0.2.3 by @Mark007-R in #22
- Harden supply chain: pin CI actions, add dependabot and lockfile by @Mark007-R in #23
- Remove Dependabot config by @Mark007-R in #26
- Read parameter descriptions from Annotated[T, "description"] by @Mark007-R in #27
- Publish outputSchema and answer with structuredContent by @Mark007-R in #28
- Accept Pydantic models as whole parameters and return types by @Mark007-R in #29
- Add an easy-mcp run command for launching a module by @Mark007-R in #30
- Release 0.2.4 by @Mark007-R in #31
Full Changelog: v0.2.3...v0.2.4
v0.2.3
Ready-made connectors
Two servers now ship with the package, each a normal MCPServer built with @server.tool and launchable with one command.
GitHub (easy-mcp-github)
list_repos,get_repo,list_issues,get_issue,list_pull_requests,get_pull_request,get_file- Reads
GITHUB_TOKENfrom the environment; works for public data without one. Standard-library HTTP only, so no new dependency. - Read-only by default.
--allow-writeaddscreate_issueandcomment_on_issue, gated by thegithub:writescope; starting with--allow-writeand no keys is refused.
Postgres (easy-mcp-postgres, install with pip install "easy-mcp-kit[postgres]")
list_schemas,list_tables,describe_table,query- Reads
DATABASE_URLfrom the environment. Every statement runs in aREAD ONLYtransaction with a statement timeout (--statement-timeout, default 10 s) and a row cap (--max-rows, default 500).
Both take --transport {http,sse,stdio}, --host, --port, --rate-limit, --debug, and load API keys from EASY_MCP_API_KEYS. python -m easy_mcp.connectors.<name> works as well.
Fixed
mypypasses again and now runs in CI.- The sliding-window rate limiter forgets idle clients, so long-running public servers no longer grow memory with every client ever seen.
- Opening a legacy SSE session now spends the client's rate-limit budget (
429+Retry-After), so an anonymous client cannot fillmax_sessions.
Changed
- API keys are compared as SHA-256 digests, so timing reveals neither partial matches nor key length.
- Per JSON Schema, a number with no fractional part (
3.0) is accepted for anintparameter and reaches the tool asint;validate_argumentsreturns the normalized arguments. - The version lives in one place (
easy_mcp/_version.py);MCPServer.check_rate_limit()is public; transports are typed againstMCPServer. - CI tests Python 3.11 through 3.14.
See CHANGELOG.md for details.
v0.2.2
Docs release: the PyPI page now carries the current README.
- MCP clients are described generically (desktop MCP hosts, CLI agents) across the README, SECURITY.md and docstrings
- "Connecting a client" shows the MCP Inspector and a short client snippet using the official MCP Python SDK
- No behavior changes since 0.2.1
Install or upgrade: pip install -U easy-mcp-kit (import name: easy_mcp)
What's Changed
- Use generic MCP client wording in the docs by @Mark007-R in #17
- Release 0.2.2 with the current README on PyPI by @Mark007-R in #18
Full Changelog: v0.2.1...v0.2.2
v0.2.1
Streamable HTTP transport: the MCP spec's current HTTP transport, served at /mcp next to the legacy SSE endpoints.
server.run()now serves Streamable HTTP at/mcpplus the legacy/sse+/messagesendpoints from one app, so new and old clients both connect;server.run("sse")keeps the legacy-only surface- Sessions via
MCP-Session-Id: 192-bit ids bound to the credential that opened them,DELETE /mcpto end one, idle expiry (session_idle_timeout),max_sessionscap Originallowlist on every HTTP endpoint (allowed_origins, loopback origins by default) rejects DNS-rebinding requests with 403- Protocol negotiation for
2024-11-05through2025-11-25; unsupportedMCP-Protocol-Versionheaders get 400;SUPPORTED_PROTOCOL_VERSIONSis exported - Legacy SSE fix:
POST /messagesanswers 202 before the tool finishes, sonotifications/cancelledcan overtake a slow call - Verified against the official MCP Python SDK 2.2.0 and TypeScript SDK 1.30.0 clients
- 13 new tests (99 total)
Backwards compatible with 0.2.0. Install or upgrade: pip install -U easy-mcp-kit (import name: easy_mcp)
What's Changed
- Add Streamable HTTP transport and release 0.2.1 by @Mark007-R in #16
Full Changelog: v0.2.0...v0.2.1
v0.2.0
stdio transport: run the same easy_mcp server as a child process of any local MCP host (desktop apps, CLI agents).
server.run("stdio")serves newline-delimited JSON-RPC over stdin/stdout;server.run()still serves HTTP + SSE- Shared dispatcher, so schema validation, scopes, rate limits, timeouts, payload caps and sanitized errors apply unchanged over stdio
- Input lines capped at
max_request_bytes; oversized lines are discarded unbuffered and answered with-32004 sys.stdoutis redirected to stderr while serving, so a strayprint()inside a tool cannot corrupt the protocol stream- Client credential via
EASY_MCP_STDIO_API_KEYorStdioTransport(server, api_key=...); an invalid key aborts startup instead of downgrading to anonymous access MCPServer.run()accepts"sse","stdio", or aTransportinstance;notifications/cancelledworks mid-call over stdio- README: transports section with an MCP host config example; SECURITY.md: transport trust boundaries
- 12 new tests including a real subprocess round trip (86 total)
Backwards compatible with 0.1.x. Install or upgrade: pip install -U easy-mcp-kit (import name: easy_mcp)
What's Changed
- Add stdio transport and release 0.2.0 by @Mark007-R in #15
Full Changelog: v0.1.0...v0.2.0