📡 MCP Radar

bagowix/dishka-fastmcp

Dishka dependency injection for FastMCP tools, resources, and prompts with request scopes and deterministic finalization.

3 stars
0 forks
Python
momentum ▲ 6.0
created 2026-07-20
on radar since 2026-07-24
dependency-injectiondidishkafastmcpiocmcpmodel-context-protocolpython
View on GitHub ↗Homepage ↗

About dishka-fastmcp

dishka IoC container integration for FastMCP. Declare dependencies as FromDishka[Service] in MCP tools, resources and prompts and let dishka resolve them per request — with real scopes, finalization and modular providers, sharing one container with the rest of your application.

The client sees a tool that takes only item — catalog is injected at call time and never appears in the schema.

Requires Python 3.11+, dishka=1.10.1, fastmcp=3.2.4,<4.

Registration time and execution time are separate concerns:

- @inject sits below the FastMCP decorator. @mcp.tool builds the JSON schema from the function signature. @inject rewrites that signature first, stripping every FromDishka parameter, so the schema the LLM sees contains only the real client-facing arguments. Order matters — @inject must be the inner decorator. - setupdishka registers a middleware that publishes the root container and current FastMCP objects through ContextVars. @inject then opens and finalizes Scope.REQUEST around the handler in the thread where it executes. This keeps sync dependency setup, use and cleanup in the same worker thread.

Scope Boundary Lifetime --------------------------- Scope.APP The whole server Owned by the root container; you close it on shutdown (see below) Scope.REQUEST One tool call / resource read / prompt render Opened and finalized by @inject around the handler

Scope.SESSION is intentionally not supported. FastMCP's middleware exposes a session-start hook (oninitialize) but no session-teardown hook, so a session-lifetime container could never be finalized deterministically. Rather

From the project README.

Maintaining this server?

Add the radar badge to your README — it shows your project was picked up by MCP Radar and links to this page:

[![On MCP Radar](https://mcp.liqiwa.com/badge.svg)](https://mcp.liqiwa.com/s/bagowix--dishka-fastmcp.html)

Related MCP servers

HalemoGPA/whatsapp-mcp-server

Authenticated, self-hosted WhatsApp MCP server that serves 96 tools for the token cost of 29, with a labeled eval for tool-retrieval accuracy. Go bridge + Python FastMCP.

⭐ 5Python
AdamRussak/self-doc

Self-hosted documentation RAG pipeline that serves semantic search to LLM agents over the Model Context Protocol.

⭐ 3Python
nisargpatel1906/Aethos_Memory

Universal, cross-tool persistent memory bank for AI assistants (Claude Code, Cursor, Windsurf, OpenCode, Codex) powered by FastMCP, Gemini embeddings & Supabase pgvector.

⭐ 5TypeScript
bybit-exchange/kaas

Turn scattered notes, docs and transcripts into a queryable Markdown wiki — an LLM knowledge-base compiler with MCP access, no embeddings, self-hosted.

⭐ 82Python
Vladimir-Human/ru-marketplace-mcp

Девять российских маркетплейсов и китайский Taobao как MCP-серверы: Wildberries, Ozon, Яндекс Маркет, Детский мир, Авито, Мегамаркет, Lamoda, DNS, Ситилинк. Плюс сравнение цен по всем сразу. Только чт

⭐ 47Python
aka-kika/hig-mcp

MCP server serving Apple Human Interface Guidelines as structured design tokens for AI coding agents — post-WWDC25 system colors, Liquid Glass constraints, SwiftUI mappings.

⭐ 31Python

📬 Get the weekly radar in your inbox

The top new MCP servers of the week, every Monday. No spam, unsubscribe anytime.