Skip to content

Commit 48799d5

Browse files
mikipaletclaude
andcommitted
feat(mcp): wire the overview MCP App view end to end
- CSP meta + color-scheme meta in the ui:// view HTML - zernio_overview tool (read-only, pinned) declaring _meta.ui.resourceUri - server card gains websiteUrl/repository/remotes (registry-manifest shape) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KaAt3g7RCFz1PpLQ4xHSyX
1 parent b18fb2e commit 48799d5

3 files changed

Lines changed: 21 additions & 1 deletion

File tree

‎src/late/mcp/http_server.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ async def handle_health(_request: Request) -> JSONResponse:
8787
"plus ad management on 7 ad networks, via MCP."
8888
),
8989
"icon": "https://media.zernio.com/site-assets/brand/icon-primary.png",
90+
"websiteUrl": "https://zernio.com",
91+
"repository": {"url": "https://github.com/zernio-dev/zernio-python", "source": "github"},
92+
"remotes": [{"type": "streamable-http", "url": f"{MCP_PUBLIC_URL}{ENDPOINT_MCP}"}],
9093
"serverInfo": {
9194
"name": "zernio",
9295
"title": "Zernio Social Media API",

‎src/late/mcp/resources.py‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from fastmcp import FastMCP
66
from fastmcp.apps import AppConfig, ResourceCSP
7+
from mcp.types import ToolAnnotations
78

89
_OVERVIEW = """\
910
# Zernio — social media and messaging API
@@ -73,6 +74,8 @@
7374
<html lang="en">
7475
<head>
7576
<meta charset="utf-8">
77+
<meta name="color-scheme" content="light dark">
78+
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'">
7679
<title>Zernio</title>
7780
<style>
7881
body { font-family: system-ui, sans-serif; margin: 0; padding: 16px; color: #1a1a1a; background: #fff; }
@@ -130,6 +133,20 @@ def authentication() -> str:
130133
def overview_view() -> str:
131134
return _OVERVIEW_VIEW_HTML
132135

136+
@mcp.tool(
137+
name="zernio_overview",
138+
description="Show an overview of what this Zernio MCP server can do (accounts, posts, analytics, ads, inbox) and how to find the right tool.",
139+
annotations=ToolAnnotations(
140+
title="Zernio server overview",
141+
readOnlyHint=True,
142+
destructiveHint=False,
143+
openWorldHint=False,
144+
),
145+
app=AppConfig(resource_uri="ui://zernio/overview.html", visibility=["model"]),
146+
)
147+
def zernio_overview() -> str:
148+
return _OVERVIEW
149+
133150
@mcp.resource(
134151
"zernio://docs/rate-limits",
135152
name="Rate limits",

‎src/late/mcp/server.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"posts_list", "posts_get", "posts_create", "posts_publish_now", "posts_cross_post",
6969
"posts_update", "posts_delete", "posts_retry", "posts_list_failed", "posts_retry_all_failed",
7070
"media_generate_upload_link", "media_check_upload_status",
71-
"docs_search",
71+
"docs_search", "zernio_overview",
7272
# Posting operations not covered by the ergonomic set
7373
"posts_bulk_upload_posts", "posts_unpublish_post", "posts_edit_post",
7474
# Scheduling queue

0 commit comments

Comments
 (0)