Taxcode

io.github.christianclaudio由 GitHub 帳號 christianclaudio 發布v1.2.0更新於 Nov 6, 2026

MCP server for US Federal, territorial, and state tax law and compliance.

概覽

AI 產生的概覽

本機 MCP 伺服器,讓助理檢索美國聯邦、波多黎各及50州稅法條文,並執行居民身分與資本利得合規計算。

可以做什麼
  • 檢索並分頁瀏覽聯邦、波多黎各與各州稅法語料,可依年度查詢歷史版本
  • 依引註、條號或紀錄 id 取得精確條文原文、版本與中繼資料
  • 依最新優先列出行政通函、稅務指引出版物與公告
  • 評估波多黎各真實居民身分標準及何時須申報 8898 表格
  • 依十年規則計算美國與波多黎各的資本利得來源歸屬
  • 評估喬治亞州居民身分與州所得稅,以及全美50州及哥倫比亞特區的居民身分、住所關聯與稅負
適用情境
適合研究美國聯邦、屬地或多州稅務問題,希望取得附引註的條文原文而非模型記憶時使用;也適合試算居民身分、住所與資本利得來源情境。不能取代專業稅務或法律意見。
執行需求
以 stdio 本機程序執行,通常透過 uvx mcp-server-taxcode(Python/uv)或已發布的容器映像啟動。需從 TAXCODE_API_KEY 讀取 API 權杖;選用設定包括 TAXCODE_BASE_URL、TAXCODE_MCP_PROFILE 與 TAXCODE_MCP_READONLY。使用 HTTP 傳輸並綁定到本機以外位址時需設定 TAXCODE_MCP_AUTH_TOKEN。
安裝前請注意
README 聲明回傳結果為計算模型與非官方摘要,不構成稅務或法律意見,以官方文本為準。需要提供服務 API 權杖(TAXCODE_API_KEY),且 TAXCODE_BASE_URL 可將請求導向其他上游 REST 端點。工具宣告為唯讀,但 README 也記載允許無驗證 HTTP 綁定的選項,會削弱存取控制。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Taxcode,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

📦 mcp-server-taxcode

[CI] [License: Apache-2.0] [Coverage] [CodeRabbit Reviews]

Enterprise-grade Model Context Protocol (MCP) server for Federal, Territorial, and Multi-State Tax Law.
Reference statutory catalog covering United States Federal (IRC/CFR), Puerto Rico (Act 60/Ley 1), and all 50 US States + District of Columbia with computational residency and capital gains models.

[!WARNING] NOT TAX OR LEGAL ADVICE / NO CONSTITUYE ASESORAMIENTO CONTRIBUTIVO NI LEGAL
EN: This software and its tools provide computational models, heuristic checks, and unofficial summaries for informational and research purposes only. Nothing returned by this server constitutes formal legal or tax advice, an official legal opinion, or audit representation. Unofficial translations and summaries are non-binding; official statutory and administrative sources in their enacted language control.
ES: Este software y sus herramientas proporcionan modelos computacionales, verificaciones heurísticas y resúmenes no oficiales únicamente para fines informativos y de investigación. Ninguna respuesta emitida por este servidor constituye asesoramiento legal o contributivo formal, una opinión legal oficial ni representación ante auditorías. Las traducciones y resúmenes no oficiales no son vinculantes; los textos estatutarios y administrativos oficiales promulgados en su idioma original prevalecen.


🏗️ Architecture: FastMCP 4 Server Composition

mermaid
graph TD    Client["AI Agent / MCP Host<br>(Claude, Cursor, Antigravity, Snowflake Cortex)"]    Gateway["FastMCP Root Gateway<br>(stdio / streamable-http)"]    ParentMW["Parent Middleware<br>(Audit Logging, Timing, Secret Redaction, ReadOnly Gate)"]    SysSub["System Sub-server (mount: 'system')<br>• system_get_health_status<br>• taxcode://system/reference/capabilities"]    StatSub["Statutes Sub-server (mount: 'statutes')<br>• statutes_lookup_statute<br>• statutes_search_tax_code<br>• statutes_list_publications<br>• taxcode://statutes/{jurisdiction}/{section*}"]    CompSub["Compliance Sub-server (mount: 'compliance')<br>• compliance_evaluate_pr_bona_fide_residency<br>• compliance_calculate_built_in_gain_sourcing<br>• compliance_evaluate_georgia_residency<br>• compliance_evaluate_state_residency"]    DuckDB["DuckDB In-Memory & File Engine<br>(144 Statutes, 37 Publications, Full-Text Search, Temporal Versions)"]
    Client <-->|"JSON-RPC (tools/list, tools/call)"| Gateway    Gateway --> ParentMW    ParentMW --> SysSub    ParentMW --> StatSub    ParentMW --> CompSub    StatSub <-->|"Point-in-Time & Full-Text Queries"| DuckDB    CompSub <-->|"Deterministic Statutory Calculations"| DuckDB

🚀 Key Features

  • Authoritative Multi-Jurisdiction Statutory Catalog:
    • Federal (US): IRC § 1, § 24, § 32, § 61, § 62, § 63, § 865, § 911, § 933, § 937, § 957, § 1411, § 6012, § 6688, 26 CFR § 1.937-1/2/3, and IRS publications (Pub. 17, Pub. 54, Pub. 501, Pub. 505, Pub. 570, Pub. 1321).
    • Puerto Rico (PR): Act 60-2019 (Resident Individual Investors, Export Services & Opportunity Zone definitions, Sec. 6020.10 annual reports), Ley 1-2011 (including Sec. 1031.02 exemptions and Sec. 1062.01 wage withholding and Sec. 1062.03 withholding on payments for services), Act 22-2012 predecessor versions, and administrative publications (CC RI 21-10, CC RI 25-12, CC RI 26-13, DA 21-04, DA 23-04, BI RI 26-02).
    • All 50 US States + District of Columbia: Comprehensive statutory definitions and tax computations covering no-income-tax states (AK, FL, NV, NH, SD, TN, TX, WA, WY), flat-tax regimes (AZ, CO, GA, ID, IL, IN, IA, KS, KY, MI, MS, NC, PA, UT), and graduated/surtax jurisdictions (AL, AR, CA, CT, DE, DC, HI, LA, ME, MD, MA, MN, MO, MT, NE, NJ, NM, NY, ND, OH, OK, OR, RI, SC, VT, VA, WV, WI) including Convenience of the Employer rules (NY, PA, NJ, CT, DE, NE) and local piggyback taxes (MD, IN, OH, NY).
  • Snippet Search, Full Text by Id: statutes_search_tax_code matches and ranks on the full text but returns a short snippet (up to 300 characters around the first matched term) plus each result's id, citation, title, jurisdiction, year, validity and content labels. Pass an id to statutes_lookup_statute as citation_or_section for the full text.
  • Bounded Responses with Paging: Every statutes tool result stays under 32,000 characters of JSON. statutes_lookup_statute returns long text in pages of up to 8,000 characters per text field (text_page gives the offset and full lengths; pass next_cursor back as page_cursor for the next page). statutes_search_tax_code and statutes_list_publications clamp limit to 1..25 items per call, with offset and next_offset for the next page. The taxcode://statutes/{jurisdiction}/{section*} resource (for example taxcode://statutes/US/933, or taxcode://statutes/IL/5/201 for a section id that contains /) uses the same 8,000-character pages and cap: a page that is not the last ends with the URI of the next one, which carries a ?page_cursor= query. The {section*} wildcard matches multi-segment section ids; a percent-encoded form such as 5%2F201 also works.
  • Versioned Data Files: Every statute and publication row lives in per-jurisdiction JSON under src/taxcode_mcp/data/ with a source record per row, and the docs under docs/ are generated from them (see CONTRIBUTING.md).
  • Temporal Statutory Versioning: Point-in-time statutory lookup with superseded_year filtering and descending historical ordering (tax_year parameter).
  • Deterministic Compliance Engines:
    • evaluate_pr_bona_fide_residency: Evaluates IRC § 937 presence (183-day, 549-day 3-year, 90-day US), tax home, and closer connection tests.
    • calculate_built_in_gain_sourcing: Allocates Section 937 / Act 60 capital gains across pre-move and post-move holding periods.
    • evaluate_state_residency: Multi-state statutory presence day-counter, permanent place of abode (PPA), domicile audit risk flags, and tax liability computation across all 50 US states and District of Columbia (51 jurisdictions total). Optional dependents, Mississippi spouse_agi (MFJ combined returns; even split of the filing-status exemption and standard deduction; ignored for other states), and Utah itemized_deductions (federal itemized deductions excluding state income tax) refine KS/MS/OH/GA/UT liability; defaults keep prior results.
  • Profiles & Opt-in ToolSearch:
    • Domain-mount profiles: full, system, statutes, compliance, readonly.
    • Job-shaped allowlist profiles: researcher (statutes + circulars), advisor (cross-border residency + BIG calculations).
  • Zero Tool Bloat: Exactly 8 lean, read-only MCP tools exposed with explicit MCP 2.0 annotations (readOnlyHint=True).

⚙️ Configuration

VariableCLI FlagDefaultDescription
TAXCODE_API_KEY—""Service API token for authentication
TAXCODE_BASE_URL—https://api.example.comUpstream REST API base URL
TAXCODE_MCP_READONLY—0Restrict server execution strictly to safe read-only inspection tools
TAXCODE_MCP_PROFILE--profilefullServer profile: full, system, statutes, compliance, readonly, researcher, advisor
TAXCODE_MCP_ENABLE_TOOL_SEARCH--enable-tool-search0Replace flat catalog with dynamic search meta-tools (profile=full only)
TAXCODE_MCP_ENABLE_CODE_MODE--enable-code-mode0Experimental Code Mode on full (requires code-mode extra)
TAXCODE_MCP_AUTH_TOKEN—""Shared bearer token for HTTP transports (streamable-http, sse)
TAXCODE_MCP_ALLOW_UNAUTHENTICATED_BIND—0Set to 1 (or true/yes/on) to let an HTTP transport bind a host other than 127.0.0.1, ::1 or localhost with no token. Without it, such a bind exits at startup

HTTP transports and authentication

Stdio is the default and needs no token. The HTTP transports follow the MCP guidance that a local server binds only to localhost and authenticates every connection:

  • On 127.0.0.1, ::1 or localhost (the --host default is 127.0.0.1), HTTP runs with or without TAXCODE_MCP_AUTH_TOKEN; without it, a warning says requests are not authenticated.
  • On any other host (0.0.0.0, ::, a LAN address), the server refuses to start unless TAXCODE_MCP_AUTH_TOKEN is set, or TAXCODE_MCP_ALLOW_UNAUTHENTICATED_BIND=1 accepts an unauthenticated bind (logged as a warning), for example behind a gateway that authenticates for you.
  • With a token set, every HTTP request needs Authorization: Bearer <token>; a missing or wrong token gets HTTP 401.
  • In the default (stateful) HTTP mode, a session idle for 30 minutes expires: its next request gets HTTP 404 and the client must start a new session. Change this with FastMCP's session_idle_timeout (on http_app()) or FASTMCP_HTTP_SESSION_IDLE_TIMEOUT (seconds, or none to never expire); see the FastMCP 4.1.0 release and #5229.
bash
# Local HTTP, loopback onlytaxcode-mcp --transport streamable-http
# Public HTTP with a tokenTAXCODE_MCP_AUTH_TOKEN="$(openssl rand -hex 32)" \  taxcode-mcp --transport streamable-http --host 0.0.0.0 --allowed-host mcp.example.com

Docker

The image's default command is stdio, so it works as a stdio server out of the box:

bash
docker run -i --rm -e TAXCODE_API_KEY=your-api-key ghcr.io/christianclaudio/mcp-server-taxcode:latest

To serve Streamable HTTP from the container, bind 0.0.0.0 inside it and pass a token:

bash
docker run --rm -p 8000:8000 \  -e TAXCODE_API_KEY=your-api-key \  -e TAXCODE_MCP_AUTH_TOKEN=your-long-random-token \  ghcr.io/christianclaudio/mcp-server-taxcode:latest \  --transport streamable-http --host 0.0.0.0 --port 8000 --allowed-host mcp.example.com

🔌 Integration Guides for AI Assistants & IDEs

This server works out-of-the-box with all major AI assistants, IDEs, and CLI tools via standard stdio or streamable-http.

The server is published on PyPI as mcp-server-taxcode, so you can run it directly with uvx mcp-server-taxcode without cloning or manually managing environments. Alternatively, run from a local clone with uv run --directory /path/to/mcp-server-taxcode taxcode-mcp.

🧡 Claude Desktop & Claude Code

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

json
{  "mcpServers": {    "taxcode": {      "command": "uvx",      "args": ["mcp-server-taxcode"]    }  }}

For local development from a clone:

json
{  "mcpServers": {    "taxcode": {      "command": "uv",      "args": ["run", "--directory", "/absolute/path/to/mcp-server-taxcode", "taxcode-mcp"]    }  }}

For Claude Code CLI:

bash
claude mcp add taxcode -- uvx mcp-server-taxcode
♊ Google Antigravity & Gemini CLI

Add to .agents/mcp_config.json (or global ~/.gemini/config/mcp_config.json):

json
{  "mcpServers": {    "taxcode": {      "command": "uvx",      "args": ["mcp-server-taxcode"]    }  }}
❄️ Snowflake Cortex Agent

Add to ~/.snowflake/cortex/mcp.json:

json
{  "mcpServers": {    "taxcode": {      "command": "uvx",      "args": ["mcp-server-taxcode"]    }  }}
💻 Cursor & Windsurf

Add to ~/.cursor/mcp.json:

json
{  "mcpServers": {    "taxcode": {      "command": "uvx",      "args": ["mcp-server-taxcode"]    }  }}
⚡ VS Code (Cline, Roo Code, GitHub Copilot Agent Mode)

Add to cline_mcp_settings.json:

json
{  "mcpServers": {    "taxcode": {      "command": "uvx",      "args": ["mcp-server-taxcode"]    }  }}

📚 Canonical Documentation & Live Doc MCPs

When developing, hardening, or extending MCP servers, consult the official framework and protocol references:

  • FastMCP 4 Framework Reference: https://gofastmcp.com/llms.txt — Server composition (mount), hierarchical middleware, transforms (ToolTransform, ToolSearch), lifespans, and in-memory test clients.
  • Model Context Protocol Specification: https://modelcontextprotocol.io/llms.txt — Official Spec (2026-07-28), wire-level JSON-RPC schemas, annotations, and transport framing.

Live Documentation MCP Endpoints (SSE / Streamable HTTP)

Connect your AI coding agent directly to live documentation servers:

  • FastMCP Documentation Server: https://gofastmcp.com/mcp (Tools: search_fast_mcp, query_docs_filesystem_fast_mcp, submit_feedback)
  • Anthropic MCP Documentation Server: https://modelcontextprotocol.io/mcp (Tools: search_model_context_protocol, query_docs_filesystem_model_context_protocol, submit_feedback)
json
{  "mcpServers": {    "fastmcp-docs": { "type": "sse", "url": "https://gofastmcp.com/mcp" },    "mcp-official-docs": { "type": "sse", "url": "https://modelcontextprotocol.io/mcp" }  }}

🏃 Local Development & Verification

bash
# 1. Install dependencies from the lockfileuv sync --locked --extra dev
# 2. Run unit tests with 100% coverage requirementuv run pytest
# 3. Static type checks & lintinguv run mypy --strict src/uv run ruff check .uv run ruff format --check .
# 4. Tool contract, protocol & drift assertionsuv run python scripts/check_tool_contract.pyuv run python scripts/check_openapi_drift.pyuv run python scripts/build_catalog.py --check   # data files, source manifest, generated docsuv run pytest tests/test_protocol.pyuv run pytest tests/test_e2e_live.py -m e2e   # on demand; default CI uses -m 'not e2e'./scripts/check_conformance.sh
# 5. AI code review gate (CodeRabbit)coderabbit review --agent --uncommitted

📄 License

Licensed under the Apache License 2.0. See LICENSE for details.

來源:README.md,提交 b48d62f

工具

8

system_get_health_status

System Get Health Status

Check the operational health of the taxcode server and DuckDB storage.

無需輸入參數。

statutes_lookup_statute

Statutes Lookup Statute

Retrieve exact statutory language, temporal version, and metadata by citation, section code, or the record id from statutes_search_tax_code (pass a result's id as citation_or_section to get its full text). Long text comes in pages of up to 8,000 characters per text field (each result stays under 32,000 characters): data.text_page gives the offset and full lengths, and while data.next_cursor is not null, call again with page_cursor set to it for the next page.

輸入參數langtax_yearpage_cursorjurisdictioncitation_or_section必填

statutes_search_tax_code

Statutes Search Tax Code

Keyword and concept search across Federal and State statutory corpora. Multi-word queries match individual terms: rows with the whole phrase rank first, then by how many terms match, then newer effective year first (empty or non-numeric years last), then id. Each result is a short snippet (up to 300 characters around the first matched term) with its id, citation, title, jurisdiction, year, validity and content labels, not the full text: call statutes_lookup_statute with citation_or_section set to the result's id to read the full text. limit is clamped to 1..25 results per call (see limit_applied); while next_offset is not null, call again with offset set to it for the next page.

輸入參數limitquery必填corpusoffsettax_yearjurisdiction

statutes_list_publications

Statutes List Publications

List administrative circulars, tax guidance publications, and bulletins, newest first. limit is clamped to 1..25 per call (see limit_applied); while next_offset is not null, call again with offset set to it for the next page.

輸入參數limitoffsetcategorysince_date

compliance_evaluate_pr_bona_fide_residency

Compliance Evaluate Pr Bona Fide Residency

Evaluate statutory criteria for PR bona fide residency under IRC § 937 and 26 CFR § 1.937-1. Its reporting_requirements say when IRS Form 8898 must be filed: in the tax year you became or stopped being a bona fide PR resident, if your worldwide gross income is more than $75,000 (IRS Instructions for Form 8898).

輸入參數tax_yeardays_present_pr必填days_present_us必填has_us_tax_homeprior_year_1_pr_daysprior_year_2_pr_dayscloser_connection_jurisdiction

compliance_calculate_built_in_gain_sourcing

Compliance Calculate Built In Gain Sourcing

Calculate US vs PR capital gain sourcing under Treas. Reg. § 1.937-2(f) (10-year rule).

輸入參數total_gain必填is_marketable必填adjusted_basistotal_days_helddays_held_as_residentfmv_on_residency_dateyears_since_residency

compliance_evaluate_georgia_residency

Compliance Evaluate Georgia Residency

Evaluate Georgia statutory residency criteria under O.C.G.A. § 48-7-1(10) and Ga. Comp. R. & Regs. r. 560-7-3-.01, and compute state income tax.

輸入參數agetax_yearfederal_agifiling_statusdays_present_ga必填retirement_incomeis_domiciled_in_gaga_driver_license_activega_voter_registration_activemaintains_permanent_abode_gaga_homestead_exemption_claimed

compliance_evaluate_state_residency

Compliance Evaluate State Residency

Evaluate individual statutory residency, domicile nexus, and state tax liability across all 50 US states and District of Columbia.

輸入參數agetax_yearfederal_agiis_domiciledjurisdiction必填capital_gainsdays_in_state必填filing_statusretirement_incomehas_active_driver_licensemaintains_permanent_abodehas_active_voter_registration另有 2 個

版本歷史

13
  1. v1.2.0最新Oct 30, 2026
  2. v1.1.0Oct 23, 2026
  3. v1.0.0Oct 22, 2026
  4. v0.8.0Oct 21, 2026
  5. v0.7.2Oct 18, 2026
  6. v0.7.1Oct 17, 2026
  7. v0.7.0Oct 17, 2026
  8. v0.6.1Oct 17, 2026
  9. v0.6.0Oct 16, 2026
  10. v0.5.1Oct 16, 2026
  11. v0.5.0Oct 15, 2026
  12. v0.1.3Oct 13, 2026
  13. v0.1.2Oct 13, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分