mcp-server-taxcode
An MCP server for read-only U.S. federal/state/Puerto Rico/Canada tax statutory research and deterministic residency/capital-gains compliance calculations.
Check server and DuckDB health.
Look up exact statutes by citation, section, or record id, with temporal
tax_year,en/es/fr, and paginated long text.Search statutes by keyword/concept, with jurisdiction/corpus filters, ranked snippets, pagination, and language selection.
List administrative publications, circulars, guidance, and bulletins by category/date, newest first.
Evaluate Puerto Rico bona fide residency under IRC § 937, including Form 8898 reporting requirements.
Calculate U.S. vs. Puerto Rico built-in gain sourcing under the 10-year rule.
Evaluate Georgia residency and compute Georgia income tax.
Evaluate residency and tax liability across all 50 U.S. states plus D.C., and Canada federal residency/tax including emigration departure tax and reporting tests.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-server-taxcode check if I qualify for Puerto Rico bona fide residency under Act 60"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
📦 mcp-server-taxcode
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.
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
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>(235 Statutes, 45 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"| DuckDBRelated MCP server: tax2ai
🚀 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).
Canada federal (
CAN): Income Tax Act ss. 2, 38, 114, 115, 117, 117.1, 118, 128.1, 153, 212 and 250 and Income Tax Regulations ss. 100, 102, 103, 105, 202, 805, 2600 and 2601, in the official English and French text of the Justice Canada consolidation (pinned laws-lois-xml commits; prior-year versions of ss. 117 and 118 from 2019), with unofficial Spanish summaries, plus CRA guidance (Folio S5-F1-C1, Forms T1161, T1243 and T1244, Leaving Canada).statutes_lookup_statuteandstatutes_search_tax_codetakelang="fr".CAstays California.
Snippet Search, Full Text by Id:
statutes_search_tax_codematches and ranks on the full text but returns a short snippet (up to 300 characters around the first matched term) plus each result'sid, citation, title, jurisdiction, year, validity and content labels. Pass anidtostatutes_lookup_statuteascitation_or_sectionfor the full text.Bounded Responses with Paging: Every statutes tool result stays under 32,000 characters of JSON.
statutes_lookup_statutereturns long text in pages of up to 8,000 characters per text field (text_pagegives the offset and full lengths; passnext_cursorback aspage_cursorfor the next page).statutes_search_tax_codeandstatutes_list_publicationsclamplimitto 1..25 items per call, withoffsetandnext_offsetfor the next page. Thetaxcode://statutes/{jurisdiction}/{section*}resource (for exampletaxcode://statutes/US/933, ortaxcode://statutes/IL/5/201for 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 as5%2F201also 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 underdocs/are generated from them (seeCONTRIBUTING.md).Temporal Statutory Versioning: Point-in-time statutory lookup with
superseded_yearfiltering and descending historical ordering (tax_yearparameter).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). Optionaldependents, Mississippispouse_agi(MFJ combined returns; even split of the filing-status exemption and standard deduction; ignored for other states), and Utahitemized_deductions(federal itemized deductions excluding state income tax) refine KS/MS/OH/GA/UT liability; defaults keep prior results.jurisdiction="CAN"(or"Canada") evaluates Canada federal residency (factual, 183-day sojourner, part-year emigrant, non-resident) and estimates federal Part I tax for 2019-2026;event="emigration"withemigration_propertiesadds the ITA s. 128.1 departure tax estimate and the T1161 reporting test.
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
Variable | CLI Flag | Default | Description |
| — |
| Service API token for authentication |
| — |
| Upstream REST API base URL |
| — |
| Restrict server execution strictly to safe read-only inspection tools |
|
|
| Server profile: |
|
|
| Replace flat catalog with dynamic search meta-tools ( |
|
|
| Experimental Code Mode on |
| — |
| Shared bearer token for HTTP transports ( |
| — |
| Set to |
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,::1orlocalhost(the--hostdefault is127.0.0.1), HTTP runs with or withoutTAXCODE_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 unlessTAXCODE_MCP_AUTH_TOKENis set, orTAXCODE_MCP_ALLOW_UNAUTHENTICATED_BIND=1accepts 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(onhttp_app()) orFASTMCP_HTTP_SESSION_IDLE_TIMEOUT(seconds, ornoneto never expire); see the FastMCP 4.1.0 release and #5229.
# Local HTTP, loopback only
taxcode-mcp --transport streamable-http
# Public HTTP with a token
TAXCODE_MCP_AUTH_TOKEN="$(openssl rand -hex 32)" \
taxcode-mcp --transport streamable-http --host 0.0.0.0 --allowed-host mcp.example.comDocker
The image's default command is stdio, so it works as a stdio server out of the box:
docker run -i --rm -e TAXCODE_API_KEY=your-api-key ghcr.io/christianclaudio/mcp-server-taxcode:latestTo serve Streamable HTTP from the container, bind 0.0.0.0 inside it and pass a token:
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.
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"taxcode": {
"command": "uvx",
"args": ["mcp-server-taxcode"]
}
}
}For local development from a clone:
{
"mcpServers": {
"taxcode": {
"command": "uv",
"args": ["run", "--directory", "/absolute/path/to/mcp-server-taxcode", "taxcode-mcp"]
}
}
}For Claude Code CLI:
claude mcp add taxcode -- uvx mcp-server-taxcodeAdd to .agents/mcp_config.json (or global ~/.gemini/config/mcp_config.json):
{
"mcpServers": {
"taxcode": {
"command": "uvx",
"args": ["mcp-server-taxcode"]
}
}
}Add to ~/.snowflake/cortex/mcp.json:
{
"mcpServers": {
"taxcode": {
"command": "uvx",
"args": ["mcp-server-taxcode"]
}
}
}Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"taxcode": {
"command": "uvx",
"args": ["mcp-server-taxcode"]
}
}
}Add to cline_mcp_settings.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)
{
"mcpServers": {
"fastmcp-docs": { "type": "sse", "url": "https://gofastmcp.com/mcp" },
"mcp-official-docs": { "type": "sse", "url": "https://modelcontextprotocol.io/mcp" }
}
}🏃 Local Development & Verification
# 1. Install dependencies from the lockfile
uv sync --locked --extra dev
# 2. Run unit tests with 100% coverage requirement
uv run pytest
# 3. Static type checks & linting
uv run mypy --strict src/
uv run ruff check .
uv run ruff format --check .
# 4. Tool contract, protocol & drift assertions
uv run python scripts/check_tool_contract.py
uv run python scripts/check_openapi_drift.py # route contract; it does not watch tax sources
uv run python scripts/check_source_freshness.py # weekly job; pinned official sources
uv run python scripts/build_catalog.py --check # data files, source manifest, generated docs
uv run pytest tests/test_protocol.py
uv run pytest tests/test_live.py -m live # on demand; default CI uses -m 'not live'
./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.
Available Tools
8 toolscompliance_calculate_built_in_gain_sourcingCompliance Calculate Built In Gain SourcingCRead-onlyIdempotent
Calculate US vs PR capital gain sourcing under Treas. Reg. § 1.937-2(f) (10-year rule).
Inputs: total_gain (required), is_marketable (required), adjusted_basis, total_days_held, +3 more. Returns: object
compliance_evaluate_georgia_residencyCompliance Evaluate Georgia ResidencyCRead-onlyIdempotent
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.
Inputs: days_present_ga (required), age, tax_year, federal_agi, +7 more. Returns: object
compliance_evaluate_pr_bona_fide_residencyCompliance Evaluate Pr Bona Fide ResidencyCRead-onlyIdempotent
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).
Inputs: days_present_pr (required), days_present_us (required), tax_year, has_us_tax_home, +3 more. Returns: object
compliance_evaluate_state_residencyCompliance Evaluate State ResidencyARead-onlyIdempotent
Evaluate individual statutory residency, domicile nexus, and state tax liability across all 50 US states and District of Columbia. jurisdiction 'CAN' or 'Canada' ('CA' is California) evaluates Canada federal residency instead (factual, deemed sojourner at 183 days, part-year emigrant or non-resident) and estimates federal Part I tax in CAD (federal_agi is taxable income, days_in_state days in Canada, tax years 2019-2026); event='emigration' adds the departure tax estimate (ITA s. 128.1).
Inputs: jurisdiction (required), days_in_state (required), age, event, +19 more. Returns: object
statutes_list_publicationsStatutes List PublicationsARead-onlyIdempotent
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.
Inputs: limit, offset, category, since_date. Returns: object
statutes_lookup_statuteStatutes Lookup StatuteARead-onlyIdempotent
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. lang is en, es or fr: Canada (CAN) rows hold the official English and French text and a Spanish summary; for a row with no French text, fr answers in the row's official language (language_fallback).
Inputs: citation_or_section (required), lang, tax_year, page_cursor, +1 more. Returns: object
statutes_search_tax_codeStatutes Search Tax CodeARead-onlyIdempotent
Keyword and concept search across Federal, State and Canada (CAN) 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. lang picks the snippet language (en, es or fr); matching reads every language a row has.
Inputs: query (required), lang, limit, corpus, +3 more. Returns: object
system_get_health_statusSystem Get Health StatusARead-onlyIdempotent
Check the operational health of the taxcode server and DuckDB storage.
Inputs: no named parameters. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Most tools have clearly distinct purposes, especially the statute search/lookup pair and the health tool. However, compliance_evaluate_state_residency overlaps with compliance_evaluate_georgia_residency because Georgia is one of the 50 states, and the state-residency tool also unexpectedly handles Canada.
All tool names use consistent snake_case and follow a predictable prefix_verb_object pattern (compliance_, statutes_, system_). Verb choices like evaluate, calculate, search, lookup, list, and get are appropriate to their actions.
Eight tools is well within the typical 3-15 range and appears well-scoped for a tax-code research and compliance-evaluation server. No tool feels redundant solely because of count.
Statute search and lookup are well covered, and several specialized residency/sourcing evaluations exist. But publications can be listed without any tool to retrieve publication details, and compliance coverage is limited to selected residency scenarios rather than a complete tax calculation surface.
Maintenance
Related MCP Connectors
Verifiable US tax oracle for AI agents: cited, machine-checkable federal and state tax computation
Current source-cited 2026 US tax constants and calculators for AI agents; every answer cites IRS.
Search US federal and state tax law: code, regs, forms, and citations, with recent changes.
Sourced Italian tax tools for AI agents: cited primary-source search + a deterministic tax engine.
Related MCP Servers
AlicenseAqualityBmaintenanceOpen-source, accountant-verified tax computation skills for AI agents. 261+ skills across 172+ jurisdictions covering income tax, VAT/GST, payroll, corporate tax, crypto, and cross-border planning. Every skill is verified section-by-section by licensed CPAs and chartered accountants. 3 tools (list_skills, get_skill, get_skill_sections) and 1 prompt (skill-review).46501AGPL 3.0- AlicenseAqualityBmaintenanceEnables AI assistants to query Korean statutes, delegated legislation, rulings, and administrative interpretations, verify citations, and calculate tax deadlines, penalties, and estimated liabilities.19MIT
- AlicenseAqualityBmaintenanceEnables AI assistants to retrieve 2027 and 2026 federal income tax brackets, standard deductions, calculated federal income tax with bracket breakdowns and year-over-year comparisons, and other tax amounts using IRS Revenue Procedure data without network calls or API keys.41MIT

dev.juriset/jurisetofficial
AlicenseAqualityBmaintenanceEnables AI agents to retrieve verified, versioned, cited jurisdiction rules, starting with US and Canadian employment and payroll rules, and to query current or historical rules, compare jurisdictions, list changes, and resolve stored versions.8MIT