Skip to main content

Stock research MCP server

examples/python-stock-research-mcp is a paid MCP server with six research tools. They join a public stock ranking feed with SEC company data. The output is educational market research, not financial advice. It shows:
  • create_solvapay_mcp_server with SolvaPay sign-in, served by uvicorn
  • Six tools registered with register_payable, each billed as one unit whatever its upstream fan-out
  • The built-in account and activate_plan tools and prompts, and the checkout widget in ChatGPT and Claude
  • Closing the HTTP clients in the Starlette lifespan
  • Tests that run against recorded market data and a mocked SolvaPay API, with no keys or network

Run it

1

Install

The example uses uv.
2

Fill in .env

PUBLIC_BASE_URL must be the URL MCP clients use. See Paid MCP server for why.
3

Start a tunnel and the server

Set MCP_PORT to use another port.
4

Connect a client

Add https://<your-tunnel>.ngrok.app/mcp to an MCP client as a remote server. The client opens SolvaPay’s sign-in, then can call the tools.

Run the tests

TypeScript examples

For MCP servers, web checkout and webhooks in TypeScript, see the TypeScript examples.