Stock research MCP server
examples/go-stock-research-mcp is a paid MCP server with six research tools. It is a port of the Python stock research example: same tools, same recorded market data, same environment, so you can compare the two servers call for call. It is educational market research, not financial advice.
It shows:
NewMCPServerwith customer sign-in through SolvaPay over OAuth.- Six tools registered with
RegisterPayable. Each call is checked against the customer’s plan, and billed as one unit when it succeeds. - SolvaPay’s
accountandactivate_plantools, the checkout widget and its prompts, added byNewMCPServer. - Tests that run the tools against a fake SolvaPay API and recorded data, with no keys or network.
Run it
Prerequisites
- Go 1.26 or later
- A sandbox secret key and a product with an active plan. See Installation.
- ngrok or another tunnel
1
Configure
From
examples/go-stock-research-mcp, copy the template and fill it in:.env
MARKET_DATA=fixtures serves the recorded market data instead of calling the live APIs.2
Start a tunnel
PUBLIC_BASE_URL. It must be the URL clients use, because it is the OAuth issuer they see. See Set PublicBaseURL.3
Start the server
http://localhost:3031/mcp.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.go test ./....
Use a published version of the SDK
The example’sgo.mod replaces the SDK with the repository’s own go/ module, so it always builds against the code next to it:
go.mod
replace and the placeholder v0.0.0 requirement, then get a version:
v0.0.0 was never published, so go get fails while go.mod still names it.