Preface¶
When performing enterprise tax declarations within an Agent, a common approach is to let the model assemble HTTP, curl, or OpenAPI calls itself. This often leads to divergent invocation paths, and it is difficult to stably reuse tax bureau login sessions and enterprise contexts. Below is an introduction to the “Enterprise Tax Submission and Tax Declaration” skill on SkillHub (@user_bbae3f97/qixiangyun-tax-declaration-skill, current version 1.0.9). It fixes the invocation surface via Qixiangyun MCP and bundled Python scripts, converging the roster of declarations to be filed, initialization, declaration upload, PDF retrieval, querying, missing declaration checks, and optional tax payment and tax payment certificates into an orchestrated closed loop. The first-time authorization on the tax bureau side is handled via a one-time HTTPS login page, followed by a reconnection to the business logic via a private flow, background waiting, and a short-term Agent Grant.
What is this¶
Positioning: An Agent Skill designed for scenarios requiring “first obtaining the tax bureau enterprise account context, then performing step-by-step declaration and verification.” It is categorized as professional, sourced from the community, and published by user_bbae3f97. The SkillHub page indicates requires_api_key=true.
Maintenance & Distribution: Skill coordinates @user_bbae3f97/qixiangyun-tax-declaration-skill; the display page and API entry are SkillHub Skill Page and Official URL respectively. As of the page snapshot, the rating is 100000 with approximately 1361 downloads.
Problems Solved: Completing declaration preparation, execution, and verification within an Agent, as well as tax payment and obtaining tax payment certificates after explicit user confirmation. Furthermore, it prohibits using Bash, curl, or hand-written HTTP to bypass the bundled scripts to connect directly to Qixiangyun interfaces.
Core Features¶
Verified via the SKILL.md and reference documents within the Skill package, the capabilities are roughly divided into three layers.
MCP Business Modules¶
| Module Alias | Purpose |
|---|---|
roster_entry |
Fetch the roster of declarations to be filed |
initialize_data |
Initialize data |
declaration_submission |
Upload declaration data |
pdf_download |
Retrieve PDF |
declaration_query |
Query declaration information |
missing_declaration_check |
Check for missing declarations |
tax_payment |
Tax payment |
tax_payment_certificate |
Tax payment certificate retrieval and parsing |
Two Types of Script Entry Points¶
scripts/mcp_client.py: Performs single tool calls based on service aliases (list services, list tools, view Schema, call tools).scripts/declaration_workflow.py: Runs the declaration/payment/certificate closed loop based on JSON configuration; supports checkpoints to prevent duplicate payment initiation after an interruption.scripts/enterprise_filing_workflow.py: Orchestrates declarations for multi-enterprise scenarios under the same login (each specific task must still be bound to one of the enterprises).
Login and Enterprise Context¶
All declaration, payment, and tax certificate commands must first create or resume a local enterprise configuration via the built-in agent_login MCP:
- First Time: The script returns a one-time
login_url; the user completes tax bureau login on an external HTTPS webpage and selects the enterprise and tax handling account; the Agent waits in the background according to the returnedwaitArgv, and executesresumeArgvto continue the original command after receivingqxy.agent_login.completed. The login link is valid for 1 hour by default; the Agent Grant generated after completion is valid for 24 hours by default and is stored in a private flow file with0600permissions. - After Session Invalidation: Do not require the user to provide the tax bureau password in the conversation; use the chat verification code flow via
scripts/managed_login_flow.py(seereferences/chat-managed-login.mdin the package for details).
The Skill explicitly requires: Never initiate a debit without explicit user confirmation; before payment, display the enterprise, tax period, tax category, amount, and masked debit account, and only execute the payment step after setting steps.payment.confirmed to true in the configuration.
Installation and Activation¶
1. Install SkillHub CLI (if not already installed)¶
command -v skillhub && skillhub --version
If not installed, follow the SkillHub Installation Instructions to run the official installation script.
2. Install this Skill¶
When installing, you must use --dir to point to the current Agent’s skills directory; otherwise, it defaults to ./skills/ which may not be recognized:
skillhub install @user_bbae3f97/qixiangyun-tax-declaration-skill --dir <skills directory>
Common paths (excerpted from SkillHub installation documentation):
- Cursor:
~/.cursor/skills/ - Claude Code:
~/.claude/skills/ - Codex:
~/.codex/skills/or.agents/skills/under the project
Alternatively, let the Agent complete the installation following the SkillHub page prompts and referencing https://skillhub.cn/install/skillhub.md.
3. Configure Qixiangyun Access Credentials¶
This Skill relies on Qixiangyun Open Platform access credentials (tagged requires_api_key=true). If not applied, you can apply at Qixiangyun Open Platform.
The Agent/deployment side reads in priority order: Process Environment → .env in the current Skill directory → qixiangyun-skill/.env. The environment variable name is QXY_API_KEY (the complete Open Platform copied value). For local single-user scenarios, you can explicitly check with the script:
python3 scripts/mcp_client.py --check-config
If you need to guide the user to submit credentials in the chat, use --check-config --allow-agent-credential-configuration and strictly pass parameters according to the agent_configuration.argv and sensitive_stdin=true returned by the script. Do not write keys into command line arguments or logs.
4. Optional Runtime Directories (Multi-tenant/Private Deployment)¶
QXY_AGENT_LOGIN_FLOW_DIR: Tenant-isolated, writable Agent login flow directory.QXY_TAX_DECLARATION_STATE_DIR: Unified override for the private runtime root directory; defaults to~/.qixiangyun/tax-declaration/agent-login-flowsif not configured.- When debugging, if calling both business and login MCPs simultaneously,
QXY_ROSTER_ENTRY_MCP_ENDPOINT,QXY_TAX_PAYMENT_MCP_ENDPOINT,QXY_TAX_PAYMENT_CERTIFICATE_MCP_ENDPOINT, andQXY_AGENT_LOGIN_MCP_ENDPOINTmust point to the same trusted deployment to share the Agent Grant storage.
After installation, read the SKILL.md within the skill package and the workflow, login, and payment instructions under references/, then let the Agent load this Skill.
Typical Usage¶
The following commands are executed in the root directory of the installed skill package, assuming the Agent has automatically injected --login-flow-id and --login-context-id from the private login completion event (terminal users must not be required to manually fill these IDs).
Explore Services and Credentials¶
python3 scripts/mcp_client.py --list-services
python3 scripts/mcp_client.py --check-config
python3 scripts/mcp_client.py --service roster_entry --list-tools
Atomic Call Example: Declaration Roster¶
Initiate task:
python3 scripts/mcp_client.py \
--login-flow-id AgentInternalFlow_ID \
--login-context-id AgentInternalSessionID \
--service roster_entry \
--tool initiate_declaration_entry_task_auto \
--args '{"aggOrgId":"YOUR_AGG_ORG_ID","year":2026,"period":4}'
Query result:
python3 scripts/mcp_client.py \
--login-flow-id AgentInternalFlow_ID \
--login-context-id AgentInternalSessionID \
--service roster_entry \
--tool query_roster_entry_task_auto \
--args '{"aggOrgId":"YOUR_AGG_ORG_ID","taskId":"TaskID"}'
Note: The top-level period represents the declaration month, not the tax attribution period month. For example, when handling the March monthly report in April 2026, pass year=2026 and period=4.
Closed-loop Declaration: Generate Config and Execute¶
Generate configuration template:
python3 scripts/declaration_workflow.py scaffold-config \
--year 2026 \
--period 4 \
--output /tmp/declaration-config.json
Only perform declaration preparation (roster + initialization):
python3 scripts/declaration_workflow.py \
run \
--config /tmp/declaration-config.json \
--steps fetch_roster,init_data
Full declaration closed loop (default steps see references/workflow.md):
python3 scripts/declaration_workflow.py run --config /tmp/declaration-config.json
For multi-enterprise orchestration, scaffold first then run:
python3 scripts/enterprise_filing_workflow.py scaffold-config \
--year 2026 \
--period 4 \
--output /tmp/enterprise-filing-config.json
python3 scripts/enterprise_filing_workflow.py run \
--config /tmp/enterprise-filing-config.json
Payment and Tax Certificate (Requires User Confirmation)¶
After explicit user confirmation for payment, change steps.payment.confirmed to true in the Agent private configuration, then execute:
python3 scripts/declaration_workflow.py run \
--config /tmp/payment-config.json \
--steps payment
Only after payment is successful and the status is verified, can the certificate step be executed:
python3 scripts/declaration_workflow.py run \
--config /tmp/payment-config.json \
--steps certificate
For the user, only display secure download links in the form of HTTPS user_download_links returned by the script; do not expose raw URLs or internal taskIds.
Applicable Scenarios and Notes¶
Who it is for
- In financial, tax, bookkeeping, or enterprise IT scenarios, where you want the Agent to complete the declaration chain only via MCP + bundled scripts to avoid the model divergently generating HTTP calls.
- Needs standardization of the orchestration and checkpoint recovery for “Login → Roster → Initialization → Declaration → PDF/Query/Missing Check → (Optional) Payment & Certificate”.
Invocation Constraints (Mandatory in Skill)
- Forbidden to use
curl,requests, OpenAPI, or hand-written HTTP to connect directly to Qixiangyun; forbidden to bypass the bundled login flow to callagent_logintools directly. - Forbidden to probe or modify local Claude/Cursor MCP configuration files to “make do” or fabricate results.
- When scripts fail, handle according to the error; do not switch channels privately.
- Do not display
flow_id, Agent Grant, checkpoint paths, raw JSON, or environment variable names to the user; the login entry should be given as a Markdown link in the conversation, not a raw URL. - Product authorization final states (e.g., fixed text for
code=505069) cannot be retried; inform the user verbatim to proceed to Qixiangyun Open Platform for renewal or to purchase the paid version. - The initialization phase will locally block unsupported tax categories, such as
BDA0610135(Individual Income Tax).
Environment and Compliance
- Requires a valid
QXY_API_KEYand Qixiangyun product authorization; when the free version trial or production authorization expires, the business will return a fixed prompt and terminate the flow according to the Skill agreement. - Cloud or multi-tenant deployments must use stable, unguessable
--login-context-idfor each tenant and configure isolated flow directories. - The regression testing documentation in the package suggests using
PYTHONDONTWRITEBYTECODE=1 python3.13 -m pytest -p no:cacheprovider, which is independent of daily Agent invocations.
Conclusion¶
“Enterprise Tax Submission and Tax Declaration” encapsulates Qixiangyun’s declaration-related MCP capabilities into fixed scripts and closed-loop configurations. It uses one-time web login and private flows to solve the enterprise context issue, making it suitable for auditable, recoverable declaration and verification flows within an Agent. See SkillHub for installation and details: https://www.skillhub.cn/skills/user_bbae3f97/qixiangyun-tax-declaration-skill, API Entry: https://api.skillhub.cn/user_bbae3f97/qixiangyun-tax-declaration-skill.