
pywss
by czasg·★ 100·Score 41
Pywss is a lightweight Python web framework with built-in MCP server capabilities supporting SSE, StreamHTTP and MCPO protocols.
Overview
Pywss is a Python web framework designed with a focus on simplicity and performance, providing an easy way to build MCP servers. The framework integrates MCP protocols directly into its architecture, allowing developers to create MCP tools using a clean, Gin/Iris-like syntax. It features automatic OpenAPI documentation generation, WebSocket support, and built-in API testing capabilities. The framework uses a thread pool mechanism for better concurrency handling and provides standardized error handling responses for MCP services.
Try asking AI
After installing, here are 5 things you can ask your AI assistant:
When to choose this
Choose Pywss when you need a lightweight Python framework with built-in MCP server capabilities and want to avoid the overhead of WSGI-based frameworks.
When NOT to choose this
Don't choose Pywss if you need advanced ORM features, extensive built-in admin interfaces, or if your project already heavily invests in Flask/Django ecosystem.
Tools this server exposes
2 tools extracted from the READMEtool_get_domaintool_get_domain(domain: str)获取单个域名服务
tool_get_trace_logtool_get_trace_log(traceId: str)获取单个trace日志
Comparable tools
Installation
Installation
pip install pywssSetting up an MCP server
from pywss import App
from pywss.mcp import MCPServer
from pydantic import BaseModel
class MyRequest(BaseModel):
param: str
class MyMCPServer(MCPServer):
@pywss.openapi.docs(description="My tool", request=MyRequest)
def tool_my_tool(self, ctx):
req = ctx.data.req
self.handle_success(ctx, {"result": req.param})
app = App()
server = MyMCPServer()
server.mount(app.group("/mcp"))
app.run()FAQ
- What MCP protocols does Pywss support?
- Pywss supports three MCP protocols: SSE (Server-Sent Events), StreamHTTP, and MCPO (Model Context Protocol Object).
- How do I define MCP tools in Pywss?
- Define methods with the 'tool_' prefix, use @pywss.openapi.docs decorator to specify parameters, and handle responses with handle_success() or handle_error().
Compare pywss with
Last updated · Auto-generated from public README + GitHub signals.