
Pse Edge Mcp
io.github.phdwight由 GitHub 帳號 phdwight 發布v0.19.1更新於 Oct 24, 2026
Philippine Stock Exchange data via PSE Edge: EOD quotes, price history, disclosures, financials.
發布方自己的服務:Edge Network
概覽
非官方的菲律賓證券交易所資料 MCP 伺服器,透過 PSE Edge 提供行情、歷史價格、公告與財報,並附菲律賓央行關鍵利率。
- 可以做什麼
- 依名稱或股票代號搜尋並驗證上市公司,讀取公司簡介
- 讀取收盤行情與每日 OHLC 歷史價格,並附上資料新鮮度資訊
- 依公司、日期或範本檢索公告,全文檢索附件內容,取得單一公告與附件連結
- 讀取財務摘要、股利與增資認股、PSEi 及各產業指數、市場總覽
- 讀取菲律賓央行關鍵利率、政策利率走廊、通膨與美元兌披索參考匯率
- 在啟用驗證的部署上,可寄一封郵件備忘給已驗證的帳號
- 適用情境
- 適合需要菲律賓市場資料做研究或報告的情境:公司篩選、價格與公告查詢、財務比較,或央行利率背景。價格為收盤資料,且在交易時段內刻意凍結,因此不能當作即時報價來源。
- 執行需求
- 可使用託管的遠端端點並走 OAuth 2.1(瀏覽器註冊並綁定通行金鑰,或無頭代理使用 client_credentials 機器用戶端),也可用 uvx 從 PyPI 套件 pse-edge-mcp 在本機以 stdio 執行,本機不需驗證。可選用 DATABASE_URL 接上 Postgres 以共用快取與封存;自行架設可用 Docker Compose。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Pse Edge Mcp,將其新增到工作區。
- 連接 所需的 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
- 為需要使用其工具的對話啟用該服務。
Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。
交給代理程式安裝
把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。
閱讀 https://sourceweft.com/mcp/io.github.phdwight%2Fpse-edge-mcp/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。其他 MCP 客戶端
把它新增到你客戶端的 mcpServers 設定中。 客戶端會在首次連接時完成 OAuth 登入。
{
"mcpServers": {
"pse-edge": {
"type": "http",
"url": "https://pse.sakayandgo.com/mcp"
}
}
}README
pse-edge-mcp
[CI] [Release] [PyPI] [Python 3.14] [License: MIT]
An MCP server exposing Philippine Stock Exchange data from the PSE Edge portal — quotes, price history, disclosures, financial reports, and market data — plus Bangko Sentral ng Pilipinas (central bank) key rates, to Claude and any other MCP client.
Unofficial. PSE Edge and BSP have no public API; this project speaks to the same endpoints their own pages use. It is not affiliated with or endorsed by the PSE or the BSP. Data is provided as-is for personal/research use, with no warranty.
Contents
- Features
- Quick start
- Design: end-of-day prices, fetch-once everything else
- Tools, resources, prompts
- Architecture
- Golden path: one request traced
- Connecting to a hosted server
- Run with Docker Compose
- Configuration
- Container image
- Production
- Development
- Contributing
- License
Features
- 15 read tools + 1 action tool covering quotes, price history, disclosures (metadata, full-text, and detail), company profiles, financials, dividends, indices, market summary, and BSP (central bank) key rates — plus an attachment resource, two prompts with symbol completion, and tool annotations.
- Deliberately gentle on PSE Edge: every unique query hits it at most once per day, and prices follow a strict market-boundary freeze.
- OAuth 2.1 + passkeys for humans (no passwords anywhere),
client_credentialsfor headless agents — both opt-in; stdio needs nothing. - Postgres optional: zero-config in-memory for local stdio, or a shared cache + an ever-deepening EOD archive when
DATABASE_URLis set. - Loud on drift: a nightly canary validates live pages against the real models and alerts only on failure; a restyled page raises an error, never partial data.
- Multi-arch container image (amd64 + arm64), gated on necessity — the image contains exactly the runtime dependency closure and nothing else.
Quick start
Claude Desktop / Claude Code (stdio):
A hosted deployment (auth on) is a normal OAuth 2.1 protected resource — modern clients need only the URL and drive the whole flow themselves (details below):
Docker (HTTP + Postgres):
Design: end-of-day prices, fetch-once everything else
Four layers, one direction of dependency. Every read goes through FreezeService.get() with an explicit per-domain policy — no tool ever touches the HTTP client directly. ★ marks the invariant the whole design exists to protect, and it guards prices only.
★ Market-boundary freeze — prices only. A cached stock price is never refetched while the market is open (09:30–15:00 Asia/Manila, trading days) — the last close answers, flagged stale. A price nobody has ever asked for is the one exception: fetched once mid-session and served as identity + previous_close only (every session-moving field withheld), with stale: true plus a meta.note saying it is not a realtime value; the settled figures replace it after the close.
If PSE Edge is unreachable and an expired entry exists, tools serve it flagged meta.stale: true rather than discarding real data for an error. EDGE_UNAVAILABLE means unreachable and nothing cached.
Every data tool returns the same envelope — meta is the freshness contract:
Tools, resources, prompts
Beyond tools, the server exposes the attachment resource above, two prompts (market_recap, company_briefing(symbol) — the symbol argument autocompletes from PSE Edge's own lookup), and MCP tool annotations so hosts can auto-approve the read-only tools. It is described for the MCP Registry in server.json.
send_email is the only tool that acts rather than reads. It has no recipient argument: the message always goes to the account that authenticated the session, so it cannot be used as a relay and there is nothing for prompt injection to redirect — which matters because this server returns disclosure text the operator does not control. It appears only on deployments with auth enabled (there is no verified address otherwise), the body is escaped rather than rendered as HTML, and it is capped at 20 messages per user per day.
Disclosure tools return metadata and links only — this server never downloads or parses attachments (beyond the explicit resource read), so your MCP client can fetch the returned URLs itself if it needs the files. Note that Edge's own full-text index is partial (roughly 2023–2025 at last check), so search_disclosure_fulltext is not a substitute for search_disclosures; it reports this limit in its results.
Financial figures are returned exactly as PSE Edge prints them and are never rescaled — Edge's own units labels are inconsistent between its annual and quarterly sections, so each period reports its currency_units for you to check. Index changes are signed here even though Edge prints them unsigned (it shows direction only as a colour and an arrow).
Architecture
The layers
Core class map
Five repositories cover the whole tool surface. Each consumes a narrow source protocol — the concrete client satisfies all five, but no repository knows that, so each is testable with a few-line fake and no HTTP mocking.
Protocols and swappable implementations
One switch picks the column: DATABASE_URL unset → in-memory / Null; set → Postgres. Postgres modules import lazily, so a lean install never pays for them.
HTTP composition — built once, in asgi.py
/health is liveness and never touches the database; /health/ready is readiness. Behind AuthApp: OAuthService (DCR · PKCE-only · refresh families), PasskeyService (WebAuthn + web sessions), TokenService (opaque pse_ tokens, SHA-256 at rest).
Error family — one root, mapped once in reply()
Watchdog
A nightly canary (pse-edge-canary, plus a compose service) fetches live pages bypassing the cache and validates the same Pydantic models the repositories build — a 200 with a restyled table is exactly the failure it exists to catch. It still refuses to run while the market is open (the ★ invariant outranks it), emails PSE_OPERATOR_EMAIL only on failure, and exits non-zero so cron notices.
Golden path: one request traced
get_stock_quote("SM") after market close, cold cache:
server.py—validation.pychecks the symbol shape (bad input →INVALID_ARGUMENT), thenreply()wraps the repository call — the only place errors become MCP error payloads.QuoteRepository.quote("SM")— resolvesSM→company_idthroughCompanyRepository, picks the endpoint, builds the cache key. Tools never see any of this.FreezeService.get(key, fetch, policy="EOD-frozen")★ — fresh cache entry → serve it. Market open + cached → serve the last close flaggedstale, never refetch. Market open + never cached → fetch once, labelstale: true+notefor the whole session. Market closed + miss → fetch. Fetch fails but an expired entry exists → serve it flaggedstale.PseEdgeClient.fetch_stock_data_page(company_id)— token bucket (1 req/s), single-flight dedupe, retries. Wire dates areMM-dd-yyyy; the JSON-vs-form dialect is chosen per endpoint.parsers.py→StockQuote— HTML → dict → validated Pydantic model. Any drift in Edge's markup raisesEndpointChangedError.cache.py/archive.py— the entry freezes until the next 15:00 close; daily bars archive opportunistically (a dead database never fails a read).
Connecting to a hosted server
A deployment with auth on is a normal OAuth 2.1 protected resource, so a modern MCP client needs only the URL — it discovers everything else and drives the whole flow itself.
What happens on first connect
Nothing here is manual except the two browser steps in bold.
- The client
POSTs to/mcpwith no token and gets 401 carryingWWW-Authenticate: Bearer resource_metadata="…/.well-known/oauth-protected-resource". That header is the entire bootstrap: it tells the client where to look next. - It fetches that document, learns which authorization server guards this resource, then reads
/.well-known/oauth-authorization-serverfor the endpoints. - It registers itself at
/oauth/register(RFC 7591) — no client secret, no operator involvement, no pre-shared credentials. It gets back aclient_id. - It opens
/oauth/authorizein a browser with a PKCE challenge (S256 required). - The user signs up or signs in. New users land on
/signup, agree to the (deliberately tiny) data policy, give an email, and receive a link; the link shows a confirm page whose button enrolls a passkey at/enroll— the confirm step exists so a mail scanner's prefetch cannot spend the link. Returning users hit/loginand use the passkey they already have. No password exists anywhere in the system. - The user approves the client on a consent screen naming it.
- The browser returns to the client with a single-use code; the client exchanges it at
/oauth/tokenwith its PKCE verifier and receives an access token (15 min) and a single-use refresh token (24 h). - The client calls
/mcpwithAuthorization: Bearer …and refreshes silently from then on. The user is not asked again.
Refresh tokens rotate on every use, and replaying a rotated one revokes that whole session family (RFC 9700 §4.14) — a stolen refresh token gets one use before the theft is detected and the session dies.
Headless agents (client_credentials)
For a LangGraph app, the Anthropic Messages API MCP connector, or any agent that cannot open a browser. No redirect, no passkey, no consent screen — a client id and secret.
1. Provision. Two routes, same result:
- From the web (needs no shell — the practical choice on a NAS): set
PSE_ADMIN_EMAILSto your account's email, sign in, and a Machine clients panel appears on/accountwith create and revoke controls. Access is gated to that allowlist — a normal signup never sees it. - From the CLI:
pse-edge-admin create-machine-client --name langgraph-app.
Either way client_id and client_secret are shown once. Only the secret's SHA-256 is stored, so it cannot be recovered — only revoked and reissued (from the same account page, or pse-edge-admin revoke-machine-client <client_id>).
2. Mint a token:
HTTP Basic works too (curl -u "$CLIENT_ID:$CLIENT_SECRET"), which is what most SDKs send. No refresh token is issued — the client already holds a long-lived secret and simply re-requests when the hour is up.
3. Use it:
Revoke with pse-edge-admin revoke-machine-client <client_id>, which kills the secret, every token it minted, and the backing service account in one step.
Registering does not grant this.
/oauth/registeris open to the internet, so a client that registers itself — even declaringgrant_types: ["client_credentials"]and sending a secret — is refused withunauthorized_client. Authorization comes from aclient_typecolumn only the admin CLI writes, never from anything a registrant says about itself.
Give each agent its own machine client: quotas are per client, so a runaway job throttles itself, and revoking one does not touch the others.
Building an app on top of this? examples/langgraph_client.py is a working client for the multi-tenant case — your app authenticates as itself with one machine client, your users never see this server. It carries an httpx.Auth that mints and refreshes the 1-hour token (verified: concurrent calls mint once; a stale token recovers on 401), plus the agent instructions worth pasting into a system prompt. Note it needs mcp<2 — langchain-mcp-adapters does not yet import against the 2.x SDK.
If your client does not do OAuth yet
The operator issues a token directly, and the user pastes it into a header. Same server, no browser:
This is also the only route on a LAN-only deployment: passkeys need a secure context, so plain http cannot enroll one.
What a user can see and remove
/account shows everything held about them — email, passkeys, active tokens, hourly usage counts. POST /account/delete erases it immediately and completely, with no approval step. /privacy states what is collected and for how long. Usage counts are deleted after 90 days.
Run with Docker Compose (HTTP + Postgres)
Serves streamable HTTP on :8000, with Postgres 18 as shared cache and archive. A one-shot migrate service applies the Alembic schema before the app starts.
HTTP mode is stateless with plain JSON responses by default. This server is read-only tools over data the freeze policy holds still, and it uses none of the features MCP sessions exist to enable — no notifications, no resource subscriptions, no sampling, no elicitation, no progress — so every request is self-contained. That means any replica can serve any request behind plain round-robin: no sticky routing, no per-session memory, no event store. Without SSE, idle clients hold no connection either. Use --stateful if you need MCP sessions and --sse for event-stream framing; they are independent flags.
Bearer auth and quotas (opt-in)
Set PSE_AUTH_REQUIRED=1 (needs DATABASE_URL) and every HTTP request must carry Authorization: Bearer <token>. Users arrive either way described in Connecting to a hosted server — self-service through OAuth 2.1 and passkeys, or an operator-issued token. PKCE is mandatory (S256 only) and no password exists anywhere in the system.
Tokens are opaque and stored only as SHA-256 hashes. Revocation (pse-edge-admin revoke-token … / disable-user …) takes effect within the validation cache's TTL — 60 s by default, which is precisely the revocation-latency budget. Per-user quotas (default 60/min, 2,000/day, overridable per user) are counted in-process and answer HTTP 429 with Retry-After; with N replicas the effective ceiling is up to N× nominal, which is fine for abuse prevention. stdio mode never authenticates — it runs on your own machine.
Operators get pse-edge-admin delete-user and purge-usage (cron the latter daily), and delete-user uses the same erasure code path as the user's own delete button, so the two cannot drift apart.
Postgres is optional. Without DATABASE_URL the server uses an in-memory cache and keeps no archive — the zero-config path for local stdio use. With it set, replicas share one cache (the freeze still means one upstream fetch per boundary however many processes run), and every read accumulates into an EOD archive (daily bars and disclosures) that deepens over time at zero extra cost to PSE Edge. Nothing crawls — the archive fills solely from fetches you already made.
Configuration
Everything is environment-sourced into one frozen Settings object. Two variables change the shape of the system: DATABASE_URL picks the storage column, and PSE_AUTH_REQUIRED turns on the whole auth stack (and the send_email tool with it).
Container image
Every merge to main publishes an image:
Both architectures are gated before publishing, on native runners. The rule is necessity, not size: the image must contain exactly the resolved runtime dependency closure and nothing else — no build toolchain, no package manager, no dev dependencies, no bytecode caches, no source tree — plus a secret scan and a smoke test that the server starts and registers its tools. A stray dependency fails the build; a large but genuinely required one does not. Image size is reported for information and never gated.
Production
One file, compose.nas.yaml, for a NAS or any single Docker host, in two stages. It pulls the published image rather than building, so production runs the artifact CI gated. Stage 1 is LAN-only and needs nothing from Cloudflare:
The tunnel profile starts cloudflared, which dials out — so there is no port forwarding, no ACME, and nothing for CGNAT to break; Cloudflare terminates TLS at its edge. Set CLOUDFLARE_TUNNEL_TOKEN, PSE_PUBLIC_URL and PSE_LAN_BIND=127.0.0.1 in .env alongside it — the last moves the stage 1 LAN port onto loopback, which is the only way to unpublish it, because Compose merges ports additively.
Both stages give auth on by default, daily backups, a daily retention purge, and no published database port. Health probes are /health (liveness) and /health/ready (readiness). The app is importable for other servers: uvicorn pse_edge_mcp.asgi:app --workers 4.
See docs/deploy.md for the full guide, including the two settings most worth getting right: pin PSE_IMAGE_TAG rather than tracking :latest, and make PSE_PUBLIC_URL the real external https URL, because WebAuthn binds every passkey to the origin it was enrolled under.
Development
Tests run entirely against recorded fixtures — CI never touches PSE Edge.
New to the codebase? docs/walkthrough.md is the developer and architect walkthrough: the request lifecycle, the freeze policy, the layering, how to add a tool or a whole data domain, and a symptom-to-cause debugging table. Also available as a PDF. For the one-page visual version of the Architecture section — classes, protocols, the data path, the config matrix — open docs/reference-card.html in any browser; it is fully self-contained and works offline. Every design decision is recorded in docs/plan.md, and the verified endpoint map lives in docs/endpoints.md.
Contributing
Issues and pull requests are welcome. The ground rules:
- Work lands on
developand reachesmainby pull request;mainis protected and requires all three CI checks (test,image (amd64),image (arm64)). - Tests never touch PSE Edge — new endpoints need new recorded fixtures in
tests/fixtures/. - New tools follow the layering above: a new data domain is a new repository plus thin tools, never fetch/parse logic in
server.py. - Bumping
versioninpyproject.tomlmakes the next merge cut a GitHub Release with a matching immutable image tag; rollCHANGELOG.mdin the same PR.
License
MIT
MCP Registry identity: mcp-name: io.github.phdwight/pse-edge-mcp
來源:README.md,提交 9af2989
工具
0版本歷史
1- v0.19.1最新Sep 16, 2026
評分
已滿足適用檢查項的 85%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通必需25 分
- 已宣告認證方式必需10 分
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
其他 Edge 整合
Edge Network
network.edge官方發布者
Edge Network 雲端平台的遠端 MCP 伺服器:助理可在同一個帳號上部署網站與應用程式、管理虛擬機器、儲存桶、DNS 以及 Shield/Assist 元件。

Historical Edge
由 GitHub 帳號 joachimglassell-ship-it 發布
遠端 MCP 伺服器,依受支持的研究與時間跨度回傳預先計算、可溯源的歷史股票研究統計資料。

Edge Actors: email verifier, DNS facts, URL to Markdown
由 GitHub 帳號 EdgeF-4 發布
由 Apify 託管的遠端 MCP 伺服器,在你的 Apify 帳戶上提供電子郵件驗證、SPF/DMARC/MX DNS 查詢與網頁轉 Markdown 功能。

Betting Edge — NFL Elo Research
由 GitHub 帳號 FedX19 發布
遠端 MCP 伺服器,提供封存的 NFL Elo 預測、賠率比較、評分、校準與公開戰績,供博彩研究使用。

ValuEdge Stock Research MCP
由 GitHub 帳號 kkfir13 發布
唯讀的股票研究伺服器,讓助理使用 ValuEdge 的搜尋、公允價值、基本面、比較與篩選工具,並檢視登入使用者自己的投資組合、自選股與提醒。