MCP API Documentation
Model Context Protocol tools for StockSignal AI.
StockSignal AI exposes a read-only MCP server that AI assistants (ChatGPT, Claude, Cursor, etc.) can connect to. Callers can discover tickers, fetch full analyses, compare tickers, and view the top-scored leaderboard.
Authentication
Endpoint: /mcp
Protocol: OAuth 2.1 via the project's Lovable Cloud auth server. The MCP server accepts only Supabase-issued bearer tokens with the authenticated audience.
Required OAuth scopes: None. Supabase access tokens do not carry scopes; the only requirement is a valid, authenticated access token obtained after the user consents.
An MCP client must complete the OAuth consent flow at /.lovable/oauth/consent. Pasting a dashboard session token will not work — the token must be issued by the OAuth authorization server and include the client claim.
Try it
Try it
Runs the same tool handlers as /mcp, authorized with your current session.
No response yet — run a tool.Equivalent JSON-RPC request to /mcp
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "list_tickers",
"arguments": {}
}
}Schemas & downloads
Machine-readable schemas
JSON Schema (2020-12) for every tool — exact input/output fields, annotations, versions, and example payloads.
list_tickersv1.0.0List available tickers · changed 2026-08-22
analyze_tickerv1.1.0Analyze ticker · changed 2026-08-23
leaderboardv1.1.0Score leaderboard · changed 2026-08-23
compare_tickersv1.0.0Compare tickers · changed 2026-08-22
Live endpoints: /api/public/mcp-schemas for the full bundle, ?tool=analyze_ticker for one tool. Responses carry an x-schema-version header.
OpenAPI 3.1 spec
Import into Postman, Insomnia, Swagger UI, or a codegen tool. One operation per MCP tool, with OAuth 2.1 security, example payloads, and 401/403/429/5xx responses.
Schema changelog
v1.1.02026-08-23- Bundle now carries schemaVersion, per-tool versions, and this changelog.
- analyze_ticker: documented coverage and confidence data-quality fields.
- leaderboard: documented the scoring window input.
- Added an OpenAPI 3.1 spec at /api/public/mcp-openapi.
v1.0.02026-08-22- Initial JSON Schema (2020-12) bundle for all four MCP tools.
TypeScript client SDK
Generated from the OpenAPI spec — typed methods for every tool, OAuth bearer auth, and 429/5xx retry with backoff. Zero runtime dependencies.
Live endpoint: /api/public/mcp-sdk returns every file as JSON; ?file=client.ts or ?file=bundle returns raw TypeScript.
Schema diff
Compare schema versions
Diff two published versions of a tool and see which changes break existing clients.
Backward compatible — additive changes only.
0 breaking · 19 non-breaking · upgrade
Breaking (0)
None — existing clients keep working.
Non-breaking (19)
input.tickerdescription changedinputDocumentation text changed; the wire contract is unchanged.
output.confidencerequired addedoutput"confidence" is now guaranteed to be present in responses.
output.coveragerequired addedoutput"coverage" is now guaranteed to be present in responses.
output.tickerdescription changedoutputDocumentation text changed; the wire contract is unchanged.
output.namedescription changedoutputDocumentation text changed; the wire contract is unchanged.
output.sectordescription changedoutputDocumentation text changed; the wire contract is unchanged.
output.pricedescription changedoutputDocumentation text changed; the wire contract is unchanged.
output.changePctdescription changedoutputDocumentation text changed; the wire contract is unchanged.
output.scoredescription changedoutputDocumentation text changed; the wire contract is unchanged.
output.ratingdescription changedoutputDocumentation text changed; the wire contract is unchanged.
output.confidencefield addedoutputNew output field "confidence" (string).
output.coveragefield addedoutputNew output field "coverage" (number).
output.pillarsdescription changedoutputDocumentation text changed; the wire contract is unchanged.
output.pillars[].keydescription changedoutputDocumentation text changed; the wire contract is unchanged.
output.pillars[].labeldescription changedoutputDocumentation text changed; the wire contract is unchanged.
output.pillars[].scoredescription changedoutputDocumentation text changed; the wire contract is unchanged.
output.pillars[].weightdescription changedoutputDocumentation text changed; the wire contract is unchanged.
output.catalystsdescription changedoutputDocumentation text changed; the wire contract is unchanged.
output.risksdescription changedoutputDocumentation text changed; the wire contract is unchanged.
Live endpoint: /api/public/mcp-schema-diff?tool=analyze_ticker&from=1.0.0&to=1.1.0. Omit tool to diff everything.
Rate limits & error responses
Rate limits
Limits are per account and reset on a rolling window. Every 429 includes a Retry-After header.
| Scope | Limit | Burst | Notes |
|---|---|---|---|
| Per authenticated user | 120 tool calls / minute | 20 in any 10s window | Shared across all four tools and the Try-it console. |
| analyze_ticker / compare_tickers | 60 calls / minute | 10 concurrent | compare_tickers counts one call per ticker in the request. |
| Unauthenticated /mcp requests | 0 (401 immediately) | — | Discovery metadata and /api/public/mcp-schemas stay open. |
401UnauthorizedMissing, malformed, or expired bearer token. Re-run the OAuth flow.
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer resource_metadata="https://<app>/.well-known/oauth-protected-resource"
{
"jsonrpc": "2.0",
"id": 1,
"error": { "code": -32001, "message": "Unauthorized: missing or expired access token" }
}403ForbiddenValid token, but the account may not call this tool (e.g. admin-only leaderboard config).
HTTP/1.1 403 Forbidden
{
"jsonrpc": "2.0",
"id": 2,
"error": { "code": -32002, "message": "Forbidden: account lacks access to this tool" }
}429Rate limitedLimit above exceeded. Wait for Retry-After seconds, then retry with backoff + jitter.
HTTP/1.1 429 Too Many Requests
Retry-After: 12
{
"jsonrpc": "2.0",
"id": 3,
"error": {
"code": -32003,
"message": "Rate limit exceeded, retry in 12s",
"data": { "retryAfterSeconds": 12, "limit": 120, "window": "60s" }
}
}5xxServer / upstream errorTransient. Retry up to 3 times with exponential backoff; then surface the message.
HTTP/1.1 503 Service Unavailable
{
"jsonrpc": "2.0",
"id": 4,
"error": {
"code": -32603,
"message": "Upstream market data unavailable",
"data": { "retryable": true }
}
}Fields that explain staleness or missing data
A 200 response can still be degraded — check these before acting on a score.
| Field | Type | What it tells you |
|---|---|---|
| coverage | number 0-1 | Share of scoring inputs actually present. Below 1 means some pillars were skipped — treat the score as a wider band. |
| confidence | "high" | "medium" | "low" | Derived from coverage and data age. low means missing or stale inputs materially weakened the score. |
| pillars[].score | number | null | null means that pillar had no usable data and was excluded from the weighted total. |
| asOf | ISO 8601 timestamp | When the snapshot was produced. Anything older than 15 minutes should be shown to end users as stale. |
| dataSource / isDemo | string / boolean | Provenance. isDemo: true (source "simulated") means the numbers are generated demo data, not live market data. |
Response headers
/mcp endpoint carries these headers, so clients can judge freshness and pace requests without parsing the body.Staleness & data quality
| Header | Type | Example | Meaning |
|---|---|---|---|
| X-StockSignal-Coverage | float 0–1 | 0.88 | Fraction of scoring inputs that had data for this response. Below 1 means some pillars were skipped and re-weighted. |
| X-StockSignal-Confidence | low | medium | high | medium | Model confidence derived from coverage and input freshness. Treat `low` as directional only. |
| X-StockSignal-As-Of | RFC 3339 timestamp | 2026-08-23T18:41:02.000Z | When the underlying market snapshot was captured. |
| X-StockSignal-Stale-Seconds | integer seconds | 412 | Age of the snapshot at response time. Clients should warn past 900s. |
| X-StockSignal-Demo | true | false | true | `true` when the payload is simulated demo data rather than a live market feed. |
| X-StockSignal-Schema-Version | semver | 1.1.0 | Version of the tool input/output schemas used to produce this response. |
| X-StockSignal-Tool-Version | semver | 0.2.0 | Version of the MCP server interface. |
Values are the worst case across everything in the response — a compare_tickers call reports the lowest coverage and the oldest timestamp of the tickers it returned.
Rate limiting
| Header | Type | Example | Meaning |
|---|---|---|---|
| X-RateLimit-Limit | integer | 120 | Per-user tool calls allowed in the 60s window. |
| X-RateLimit-Remaining | integer | 117 | Per-user calls left in the current window. |
| X-RateLimit-Reset | unix seconds | 1774291320 | When the per-user window resets. |
| X-RateLimit-Tool-Limit | integer | 60 | Per-tool calls allowed in the window for this caller. |
| X-RateLimit-Tool-Remaining | integer | 59 | Per-tool calls left for this caller. |
| Retry-After | integer seconds | 12 | Only present on 429. Wait this long before retrying (add jitter). |
Counters are per caller (OAuth subject) over a rolling 60s window and are enforced per server instance, so treat remaining counts as approximate under heavy fan-out.
Example: successful tool call
HTTP/1.1 200 OK
Content-Type: application/json
X-StockSignal-Coverage: 0.88
X-StockSignal-Confidence: medium
X-StockSignal-As-Of: 2026-08-23T18:41:02.000Z
X-StockSignal-Stale-Seconds: 412
X-StockSignal-Demo: true
X-StockSignal-Schema-Version: 1.1.0
X-StockSignal-Tool-Version: 0.2.0
X-RateLimit-Limit: 120
X-RateLimit-Remaining: 117
X-RateLimit-Reset: 1774291320
X-RateLimit-Tool-Limit: 60
X-RateLimit-Tool-Remaining: 59
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"structuredContent": {
"ticker": "EXEL",
"score": 78,
"rating": "Buy",
"confidence": "medium",
"coverage": 0.88,
"isDemo": true
}
}
}Example: rate limited
HTTP/1.1 429 Too Many Requests
Content-Type: application/json
X-RateLimit-Limit: 120
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1774291380
Retry-After: 12
{
"jsonrpc": "2.0",
"id": 7,
"error": {
"code": -32003,
"message": "Rate limit exceeded, retry in 12s",
"data": { "limit": 120, "windowSeconds": 60, "retryAfter": 12 }
}
}Versioning & status
Server version
0.2.0
Min compatible
0.2.0
MCP protocol
2025-06-18
Interface last changed
2026-08-23
Compatibility check: GET /mcp/status (public mirror: /api/public/mcp-status). Tools follow semver — a major bump means a breaking input/output change, a minor bump means additive fields.
Tool versions
| Tool | Version | Status | Last changed | What changed |
|---|---|---|---|---|
| list_tickers | 1.0.0 | stable | 2026-08-22 | Ticker discovery. Inputs and output shape unchanged since launch. |
| analyze_ticker | 1.1.0 | stable | 2026-08-23 | Added coverage/confidence data-quality fields alongside the pillar breakdown; existing fields unchanged. |
| compare_tickers | 1.0.0 | stable | 2026-08-22 | Side-by-side comparison of 2-4 tickers. |
| leaderboard | 1.1.0 | stable | 2026-08-23 | Added the admin-controlled scoring window (1M/3M/6M/1Y) to inputs and output. |
Changelog
v0.2.02026-08-23- OAuth 2.1 protection added — all tool calls require a signed-in StockSignal AI account.
- analyze_ticker now returns coverage and confidence.
- leaderboard accepts a scoring window.
- Published machine-readable JSON Schemas at /api/public/mcp-schemas.
v0.1.02026-08-22- Initial MCP server with list_tickers, analyze_ticker, compare_tickers, leaderboard.
Tools
List available tickers
list_tickersList every US ticker available in the StockSignal AI demo dataset, with company name and sector.
Inputs
No inputs required.
Outputs
| Field | Type | Description |
|---|---|---|
| tickers | object[] | Array of { ticker, name, sector } objects. |
Analyze ticker
analyze_tickerReturn the full StockSignal AI analysis for a US ticker from the demo dataset: current price, 0-100 score, rating, per-pillar scores, catalysts, risks, and bull/base/bear cases.
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
| ticker | string | Required | US stock ticker symbol, e.g. EXEL, NVDA, AAPL. |
Outputs
| Field | Type | Description |
|---|---|---|
| ticker | string | Uppercase ticker symbol. |
| name | string | Company name. |
| sector | string | Industry sector. |
| price | number | Simulated current price. |
| changePct | number | Simulated daily percent change. |
| score | integer | Overall 0-100 score. |
| rating | string | Plain-English rating (e.g. Strong Buy, Buy). |
| confidence | string | High / Medium / Low confidence. |
| coverage | number | Percent of input pillars that have data. |
| pillars | object[] | Per-pillar scores with key, label, score, weight. |
| catalysts | string[] | Upcoming catalysts. |
| risks | string[] | Key risk flags. |
| cases | object | Bull / base / bear narrative cases. |
Score leaderboard
leaderboardRank the StockSignal AI demo tickers by overall 0-100 score, highest first. Optional limit.
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
| limit | integer | Optional | Max number of tickers to return (default 10, max 50). |
Outputs
| Field | Type | Description |
|---|---|---|
| leaders | object[] | Array of { ticker, name, sector, score, rating, confidence, changePct }. |
Compare tickers
compare_tickersCompare 2-4 US tickers side by side: score, rating, price, percent change, and per-pillar scores. Missing tickers are reported in the response.
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
| tickers | string[] | Required | 2 to 4 US ticker symbols to compare. |
Outputs
| Field | Type | Description |
|---|---|---|
| comparison | object[] | Array of per-ticker result objects, including available flag. |