Skip to main content
The spend-export example demonstrates a skill that converts supplied audit receipts into CSV. Its tests use a mock client. They do not prove that a hosted audit stream or install flow is connected.

Inspect the example

In examples/build-a-skill-spend-export, read:
  • manifest.yml for the skill metadata.
  • policy-template.json for the suggested policy.
  • consent-flow.md for the requested access.
  • src/skill.ts for exportLastMonthSpend.
  • src/skill.test.ts for the mock-client tests.
Copy the example directory to start your own skill. Update its identity, permissions, consent copy and entry point to match what your implementation does.

Connect the data source

exportLastMonthSpend expects its client to return an array of events containing receipts. The MCP audit.stream contract returns a stream cursor instead. Implement an adapter that obtains authorized events and supplies the shape expected by the example; the example is not a direct drop-in client for that endpoint. The function parses receipt rows with parseSpendReceipt and returns CSV using exportCsv. It skips malformed receipts. Review skipped rows before using the output for accounting.

Run the tests

With product-repository dependencies installed, run from the repository root:
These tests exercise the example’s manifest and CSV behavior. Validate the real data source, grant scope and consent flow separately before publishing your skill.

Source

Read the spend-export skill example. Source access is required.

Next