Skip to content

Commit 0323c4b

Browse files
authored
feat: add a brand mark for modern-di-fastmcp (#146)
1 parent 191d8ca commit 0323c4b

10 files changed

Lines changed: 33 additions & 1 deletion

File tree

‎brand/build/projects.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"modern-di-arq": lambda: sym.hopper(_CX, _CY, R),
2525
"modern-di-celery": lambda: sym.celery_stalk(_CX, _CY, R),
2626
"modern-di-fastapi": lambda: sym.bolt_disc(_CX, _CY, R),
27+
"modern-di-fastmcp": lambda: sym.plug(_CX, _CY, R),
2728
"modern-di-faststream": lambda: sym.faststream(_CX, _CY, R),
2829
"modern-di-flask": lambda: sym.flask_horn(_CX, _CY, R),
2930
"modern-di-grpc": lambda: sym.rpc_arrow(_CX, _CY, R),

‎brand/build/symbols.py‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,32 @@ def rpc_arrow(cx: float, cy: float, r: float) -> str:
584584
return out
585585

586586

587+
def plug(cx: float, cy: float, r: float) -> str:
588+
"""FastMCP cue: a plug, MCP being the port tools plug into, with a bolt knocked out."""
589+
bw, bh = 1.3 * r, 1.0 * r
590+
top = cy - 0.6 * r
591+
prong_w, prong_h = 0.21 * r, 0.45 * r
592+
prongs = "".join(
593+
f'<rect x="{cx + dx * r - prong_w / 2:.1f}" y="{top - prong_h:.1f}" '
594+
f'width="{prong_w:.1f}" height="{prong_h + 0.1 * r:.1f}" rx="{prong_w * 0.3:.1f}" fill="{GOLD}"/>'
595+
for dx in (-0.3, 0.3)
596+
)
597+
body = (
598+
f'<rect x="{cx - bw / 2:.1f}" y="{top:.1f}" width="{bw:.1f}" height="{bh:.1f}" '
599+
f'rx="{0.22 * r:.1f}" fill="{GOLD}"/>'
600+
)
601+
cord = (
602+
f'<path d="M{cx:.1f},{top + bh - 0.05 * r:.1f} '
603+
f"C{cx:.1f},{cy + 0.85 * r:.1f} {cx + 0.5 * r:.1f},{cy + 0.7 * r:.1f} "
604+
f'{cx + 0.75 * r:.1f},{cy + 0.95 * r:.1f}" fill="none" stroke="{GOLD}" '
605+
f'stroke-width="{0.24 * r:.1f}" stroke-linecap="round"/>'
606+
)
607+
bcy = top + bh / 2
608+
norm = [(0.12, -0.38), (-0.24, 0.07), (0.0, 0.07), (-0.12, 0.38), (0.24, -0.07), (0.0, -0.07)]
609+
bolt = " ".join(f"{cx + dx * r:.1f},{bcy + dy * r:.1f}" for dx, dy in norm)
610+
return prongs + body + cord + f'<polygon points="{bolt}" fill="{CREAM}"/>'
611+
612+
587613
def key(cx: float, cy: float, r: float) -> str:
588614
"""jwks-client: a key, the signing key a JWKS publishes."""
589615
sw = r * 0.2
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
2 KB
Loading
7.47 KB
Loading
3.33 KB
Loading
Lines changed: 1 addition & 0 deletions
Loading

‎docs/index.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ production Python services. Each project is independent, so use one piece or all
6868
[`modern-di`](https://github.com/modern-python/modern-di): typed, scoped
6969
dependency injection with one wiring shared across web frameworks (FastAPI,
7070
Litestar, Starlette, Flask, aiohttp), task queues (Celery, arq, taskiq), RPC
71-
and messaging (gRPC, FastStream, aiogram), and CLIs (Typer).
71+
and messaging (gRPC, FastStream, aiogram), MCP servers (FastMCP), and CLIs
72+
(Typer).
7273
([`that-depends`](https://github.com/modern-python/that-depends), the older
7374
DI framework, is still maintained.)
7475
- Call other services reliably with

‎tests/test_projects.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def test_project_frame_parses_and_uses_tokens() -> None:
4747
"modern-di-taskiq",
4848
"modern-di-flask",
4949
"modern-di-grpc",
50+
"modern-di-fastmcp",
5051
"jwks-client",
5152
"release-scope",
5253
}

0 commit comments

Comments
 (0)