Pywss

v1.0.0Developer Toolsstable

一个轻量级的 Python Web 框架,一站式集成 MCP SSE、StreamHTTP 和 MCPO 协议,助你轻松构建MCP Server🔥

mcpmcp-serverpythonpython-webpywss
Share:
100
Stars
0
Downloads
0
Weekly
0/5

What is Pywss?

Pywss is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to 一个轻量级的 python web 框架,一站式集成 mcp sse、streamhttp 和 mcpo 协议,助你轻松构建mcp server🔥

一个轻量级的 Python Web 框架,一站式集成 MCP SSE、StreamHTTP 和 MCPO 协议,助你轻松构建MCP Server🔥

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • 一个轻量级的 Python Web 框架,一站式集成 MCP SSE、StreamHTTP 和 MCPO 协议,助你轻松

Use Cases

Build MCP servers easily with lightweight Python web framework. Integrate MCP SSE, StreamHTTP, and MCPO protocols in one place.
czasg

Maintainer

LicenseMIT
Languagepython
Versionv1.0.0
UpdatedApr 8, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx pywss

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Pywss

Pywss is a lightweight Python web framework that provides first-class support for building MCP servers with integrated SSE, StreamHTTP, and MCPO protocol handling in a single package. Developers define MCP tools as class methods prefixed with 'tool_', annotate them with Pydantic models for automatic parameter validation and OpenAPI documentation, and then mount them to route groups with one call. This makes Pywss well suited for teams who want to create internal MCP servers using Python web conventions rather than wrapping a CLI tool, and who need to serve multiple independent MCP services on different route paths from a single process.

Prerequisites

  • Python 3.6 or higher installed
  • pip or pip3 available for installing the package
  • Pydantic installed (installed automatically as a pywss dependency)
  • An MCP-compatible client such as Claude Desktop that supports SSE or StreamHTTP transports
1

Install pywss

Install pywss from PyPI using pip. This pulls in all required dependencies including Pydantic.

pip3 install pywss
2

Create an MCP server class

Create a Python file defining your MCP server. Subclass pywss.mcp.MCPServer, name your tool methods with the 'tool_' prefix, and annotate them with @pywss.openapi.docs and a Pydantic request model.

# mcp_server.py
import pywss
from pydantic import BaseModel
from pywss.mcp import MCPServer

class SearchReq(BaseModel):
    query: str

class MyMCPServer(MCPServer):
    @pywss.openapi.docs(description="Search for items", request=SearchReq)
    def tool_search(self, ctx: pywss.Context):
        req: SearchReq = ctx.data.req
        self.handle_success(ctx, {"results": [f"Result for {req.query}"]})

mcp = MyMCPServer()
app = pywss.App()
app.openapi()
mcp.mount(app.group("/api/v1/search"))
app.run()
3

Start the server

Run your Python file to start the pywss application. By default it listens on port 8080.

python3 mcp_server.py
4

Identify the protocol endpoints

Each mounted MCPServer automatically exposes three protocol endpoints. For the example above mounted at /api/v1/search, the endpoints are: SSE at GET /api/v1/search/sse, StreamHTTP at POST /api/v1/search/mcp, and MCPO at POST /api/v1/search/tools/{tool_name}.

5

Connect your MCP client to the SSE endpoint

Point your MCP client at the SSE endpoint. For Claude Desktop, configure an SSE-transport server entry pointing to your running pywss server.

{
  "mcpServers": {
    "pywss-search": {
      "url": "http://localhost:8080/api/v1/search/sse"
    }
  }
}

Pywss Examples

Client configuration

For clients that support SSE transport, point them at the pywss SSE endpoint. Replace the URL with your server's host and the route you mounted the MCPServer on.

{
  "mcpServers": {
    "pywss": {
      "url": "http://localhost:8080/api/v1/myservice/sse"
    }
  }
}

Prompts to try

Once your pywss MCP server is running and connected, try these prompts based on the tools you defined.

- "Call the search tool with query 'python async'."
- "What tools are available on this MCP server?"
- "Use tool_get_domain to look up domain 'example.com'."
- "Run the tool_get_trace_log function for trace ID 'abc-123'."
- "Show me the OpenAPI documentation for this service at http://localhost:8080/openapi"

Troubleshooting Pywss

ImportError: No module named 'pywss'

Run 'pip3 install pywss' in the same Python environment you are using to run your server. If using virtual environments, activate it first.

MCP client cannot connect to the SSE endpoint

Confirm the pywss app is running and listening on the expected port (default 8080). Check that the URL in your client config matches the route you passed to mcp.mount(). Test the endpoint with: curl http://localhost:8080/api/v1/yourservice/sse

Tool methods are not discovered by the MCP client

Ensure every tool method name starts with 'tool_' and is decorated with @pywss.openapi.docs with both 'description' and 'request' arguments. Methods missing either the prefix or the decorator will not be registered as MCP tools.

Frequently Asked Questions about Pywss

What is Pywss?

Pywss is a Model Context Protocol (MCP) server that 一个轻量级的 python web 框架,一站式集成 mcp sse、streamhttp 和 mcpo 协议,助你轻松构建mcp server🔥 It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Pywss?

Follow the installation instructions on the Pywss GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Pywss?

Pywss works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Pywss free to use?

Yes, Pywss is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "pywss": { "command": "npx", "args": ["-y", "pywss"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Pywss?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides