GoldenPi Bonds MCP Server

GoldenPi Bonds MCP Server

Provides tools to list and search bonds from GoldenPi via reverse-engineered API endpoints.

Category
访问服务器

README

GoldenPi Bonds MCP Server

A Model Context Protocol server that exposes GoldenPi's reverse-engineered bond discovery APIs.

Tools:

  • goldenpi_list_bonds — filtered, paginated bond listing via POST /v0/bonds/list
  • goldenpi_search_bonds — free-text bond search via POST /v0/bonds/search

Installation

cd goldenpi-mcp
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
cp .env.example .env

Configuration

Copy .env.example to .env and edit as needed:

cp .env.example .env

Key variables:

Variable Default Purpose
GOLDENPI_BASE_URL https://api.goldenpi.com GoldenPi API base URL
GOLDENPI_CLIENT_TOKEN (none) Optional static token. If unset or rejected, the server falls back to /v0/auth/handshake.
GOLDENPI_PARTNER_ID GoldenPi-Securities Partner ID sent during handshake
GOLDENPI_SEND_DEPOSITORY_HEADER 0 Set to 1 to send x-gpi-client-depositoryid on POSTs. Off by default because the live API rejects it on bond endpoints.
GOLDENPI_MCP_TRANSPORT sse sse for ChatGPT apps / Render, stdio for OpenCode/Claude Desktop
GOLDENPI_MCP_HOST / GOLDENPI_MCP_PORT 0.0.0.0 / 8080 SSE server bind address. The standard PORT env var takes precedence over GOLDENPI_MCP_PORT.

Auth behavior:

  1. Uses GOLDENPI_CLIENT_TOKEN if set.
  2. If the static token fails with an auth/header error, automatically calls POST /v0/auth/handshake to obtain a guest token and retries.
  3. If handshake also fails, the server exits immediately with a clear error.

Note: As of the latest test, the embedded static token from the frontend bundle is rejected by the live API. The handshake guest token works, so leaving GOLDENPI_CLIENT_TOKEN unset (or commented out) is the most reliable default.

Header note: The frontend only sends x-gpi-client-token on POST requests. Sending x-gpi-client-depositoryid on POST /v0/bonds/list causes an "invalid header" error, so this server does not send it by default. Set GOLDENPI_SEND_DEPOSITORY_HEADER=1 only if you specifically need it.

Running for ChatGPT / SSE clients (default)

python -m goldenpi_mcp.server

By default the server runs in SSE mode on 0.0.0.0:8080. Your ChatGPT app should connect to:

http://localhost:8080/sse

On Render, set the start command to python -m goldenpi_mcp.server and the server will automatically bind to the PORT env var Render provides.

Running locally (stdio / OpenCode / Claude Desktop)

python -m goldenpi_mcp.server --transport stdio

OpenCode / Claude Desktop config:

{
  "mcpServers": {
    "goldenpi-bonds": {
      "command": "python",
      "args": ["-m", "goldenpi_mcp.server", "--transport", "stdio"],
      "env": {
        "GOLDENPI_DEPOSITORY_ID": "GoldenPi"
      }
    }
  }
}

Tool reference

goldenpi_list_bonds

Filtered, paginated bond discovery via POST /v0/bonds/list. Does not support free-text search — use goldenpi_search_bonds for name/ISIN/issuer queries.

Pagination & sorting

Parameter Type Description
sort_by enum How to sort. Default: yield-high-to-low.
limit int Results per page. Range: 1–50. Default: 10.
offset int 1-based page number. Default: 1.

Core filters

Parameter Type Description
asset_classes list Instrument types: NCD, NCD-IPO, GSEC, SDL, CGTB, SGB-IPO. Defaults to NCD, NCD-IPO.
credit_ratings list aaa, aa, a, sovereign. sovereign matches government securities.
min_yield / max_yield number YTMC % range. Omit either side for open-ended.
min_investment_inr / max_investment_inr number Settlement amount per lot in INR.
payment_frequencies list annual, half-yearly, quarterly, monthly, thrice-yearly, on-maturity.
issuer_types list nbfc, corporate, psu, psb, bank, government, gsec, sdl, rbi. gsec/sdl also enable government asset classes.
min_tenure_months / max_tenure_months int Remaining tenure in whole months. Ignored if tenure_preset is set.
tenure_preset enum Shortcut: less-than-1y, 1-5y, 5-10y, more-than-10y, short-term-3y.
investment_purpose enum Strategy preset applying multiple filters at once, e.g. highest-safety, tax-free-investment, invest-short-time.

Boolean flags

Parameter Description
tax_free_only Tax-free bonds only. Mutually exclusive with taxable_only.
taxable_only Taxable bonds only.
nri_eligible_only NRI-eligible bonds only.
secured_only / unsecured_only Secured or unsecured only. Mutually exclusive.
perpetual_only / non_perpetual_only Perpetual or non-perpetual only. Mutually exclusive.
call_option_only / no_call_option_only With or without call option. Mutually exclusive.
pledge_for_fno_only Accepted as pledge for F&O margin.
huf_tax_exemption_only HUF tax exemption available.
spotlight_only Featured/spotlight bonds only.

Advanced filters

Parameter Type Description
issuer_mode enum public (Public Placement) or private (Private Placement).
face_values list 1000, 10000, 100000, 200000, 1000000, above-10-lacs. Combined into a range.
bond_price_level enum discount, par, premium.
bank_bond_tier enum tier_i, tier_ii, tier_iii.
seniority enum senior or subordinate.
depository_listing enum nsdl, cdsl, both.
listed list Override listing filter. [1] = active deals, [0] = primary/IPO, [0,1] = both.
include_marketing_details bool Include featured/UTSAV campaign metadata.

Output:

{
  "totalCount": 123,
  "filteredCount": 45,
  "hasMore": true,
  "bonds": [ /* full instList rows */ ]
}

goldenpi_search_bonds

Free-text search across bonds/FDs/IPOs via POST /v0/bonds/search.

Parameter Required Description
search_filter yes Name, ISIN, or issuer text. Minimum 2 characters.
sort_by no yield-high-to-low (default) or yield-low-to-high.
limit no Results per page. Range: 1–50. Default: 10.
offset no 1-based page number. Default: 1.

Testing

pytest

Legal / risks

This is an unofficial reverse-engineered integration. GoldenPi may change their API without notice. Use at your own risk and respect their terms of service.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选