@stellar-agent-services/dev-mcp 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +50 -2
  3. package/dist/docs.d.ts +35 -0
  4. package/dist/docs.d.ts.map +1 -0
  5. package/dist/docs.js +92 -0
  6. package/dist/docs.js.map +1 -0
  7. package/dist/index.d.ts +3 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +6 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/server.d.ts +14 -0
  12. package/dist/server.d.ts.map +1 -0
  13. package/dist/server.js +125 -0
  14. package/dist/server.js.map +1 -0
  15. package/package.json +40 -4
  16. package/repository/AGENTS.md +162 -0
  17. package/repository/CONTRIBUTING.md +95 -0
  18. package/repository/IMPLEMENTATION_PLAN.md +560 -0
  19. package/repository/README.md +80 -0
  20. package/repository/SECURITY.md +22 -0
  21. package/repository/apps/wallet/README.md +78 -0
  22. package/repository/docs/client-integration/README-AI.md +495 -0
  23. package/repository/docs/client-integration/README.md +138 -0
  24. package/repository/docs/dx-improvements.md +670 -0
  25. package/repository/docs/erc-compatibility.md +163 -0
  26. package/repository/docs/job-recovery.md +201 -0
  27. package/repository/docs/payment-client.md +290 -0
  28. package/repository/docs/provider-setup-guide.md +348 -0
  29. package/repository/docs/provider-standard.md +728 -0
  30. package/repository/docs/recovery/README-AI.md +288 -0
  31. package/repository/docs/recovery/README.md +119 -0
  32. package/repository/docs/sow-closeout.md +67 -0
  33. package/repository/docs/standard/README-AI.md +614 -0
  34. package/repository/docs/standard/README.md +108 -0
  35. package/repository/docs/verification.md +504 -0
  36. package/repository/examples/paid-service/README.md +33 -0
  37. package/repository/examples/python-upstream/README.md +44 -0
  38. package/repository/llms.txt +65 -0
  39. package/repository/packages/create-stellar-service/README.md +143 -0
  40. package/repository/packages/dev-mcp/README.md +51 -0
  41. package/repository/packages/payment-client/README.md +98 -0
  42. package/repository/packages/protocol/README.md +15 -0
  43. package/repository/packages/protocol/schemas/manifest.schema.json +272 -0
  44. package/repository/packages/protocol/test-vectors/README.md +45 -0
  45. package/repository/packages/provider-kit/README.md +509 -0
  46. package/repository/packages/provider-kit/schemas/gateway-config.schema.json +140 -0
  47. package/repository/packages/verifier/README.md +131 -0
  48. package/repository/plugins/stellar-agent-services/README.md +31 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Stellar Agent Services contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,51 @@
1
- # Temporary Holding Version
1
+ # @stellar-agent-services/dev-mcp
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ An MCP server for coding agents that build on [Provider Standard v1](../../docs/provider-standard.md): a provider,
4
+ a gateway config, a native implementation or a paying client. It answers from this repository's documents and runs
5
+ the verifier's unpaid checks.
6
+
7
+ **It holds no key and never pays.** It is not the payment client's MCP server, which would let an agent hire
8
+ providers. That one is planned in [packages/payment-client](../payment-client/README.md).
9
+
10
+ | Tool | What it does |
11
+ | --- | --- |
12
+ | `list_docs` | The documentation index, [llms.txt](../../llms.txt) |
13
+ | `read_doc` | One document from that index, by repository path (`AGENTS.md`, `docs/provider-standard.md`) or llms.txt URL. Nothing outside the index can be read. |
14
+ | `search_docs` | Lines of the indexed documents that contain every term of a query, as `path:line` |
15
+ | `get_spec_rule` | A rule of the standard by id (`J13`, `[M5]`), with its section |
16
+ | `validate_manifest` | Check C1 on a manifest document before it is served: JSON Schema [M9], the rules it can't express, service schemas, SHOULD rules. Same code as the verifier. |
17
+ | `check_provider` | `verifier check` on a running provider: C1, C2, C3, C6 and an unpaid C7 burst. C4 and C5 need a payer, so they are skipped. |
18
+
19
+ ## Use
20
+
21
+ ```bash
22
+ # Claude Code
23
+ claude mcp add stellar-agent-services -- npx -y @stellar-agent-services/dev-mcp
24
+ ```
25
+
26
+ Any other MCP client takes the same command as a stdio server:
27
+
28
+ ```json
29
+ {
30
+ "mcpServers": {
31
+ "stellar-agent-services": { "command": "npx", "args": ["-y", "@stellar-agent-services/dev-mcp"] }
32
+ }
33
+ }
34
+ ```
35
+
36
+ Installed from npm, it reads the documents packed with it in `repository/`, from the same commit as its code. Run from
37
+ a clone instead (`node packages/dev-mcp/dist/index.js`, after `npm install && npm run build`), it reads the clone's
38
+ documents, so `git pull && npm run build` updates it.
39
+
40
+ As a library, `createServer(options)` returns the `McpServer`. `options.verify` passes options to
41
+ `verifyProvider()`, such as an offline provider's `fetch` in tests. It never takes a payer.
42
+
43
+ ## Files
44
+
45
+ | File | Contents |
46
+ | --- | --- |
47
+ | `src/server.ts` | `createServer()`: the tools |
48
+ | `src/docs.ts` | The llms.txt index, document reads and search, spec rule parsing |
49
+ | `src/index.ts` | The stdio entry point |
50
+ | `scripts/pack-docs.mjs` | Before npm packs the package: copies llms.txt and every document it links to into `repository/` |
51
+ | `test/server.test.ts` | Every tool through a real MCP client; `check_provider` against the verifier's offline provider |
package/dist/docs.d.ts ADDED
@@ -0,0 +1,35 @@
1
+ export interface DocEntry {
2
+ /** Repository path, such as docs/provider-standard.md. */
3
+ path: string;
4
+ title: string;
5
+ summary: string;
6
+ /** The llms.txt section, such as "Build a provider". */
7
+ section: string;
8
+ }
9
+ export interface SpecRule {
10
+ id: string;
11
+ /** The heading the rule is under, such as "5.4 Processing order". */
12
+ section: string;
13
+ text: string;
14
+ }
15
+ export interface SearchHit {
16
+ path: string;
17
+ line: number;
18
+ text: string;
19
+ }
20
+ export declare class Docs {
21
+ private readonly root;
22
+ readonly index: string;
23
+ readonly entries: DocEntry[];
24
+ private rules;
25
+ constructor(root: URL);
26
+ /** The entry for a repository path or its raw GitHub URL, when llms.txt lists it. */
27
+ entry(pathOrUrl: string): DocEntry | undefined;
28
+ read(entry: DocEntry): string;
29
+ /** Lines containing every term of the query, case-insensitive, in llms.txt order. */
30
+ search(query: string, limit: number): SearchHit[];
31
+ /** A spec rule by id: "J13", "[J13]" or "j13". */
32
+ rule(id: string): SpecRule | undefined;
33
+ ruleIds(): string[];
34
+ }
35
+ //# sourceMappingURL=docs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../src/docs.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,QAAQ;IACvB,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,qEAAqE;IACrE,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,IAAI;IAKH,OAAO,CAAC,QAAQ,CAAC,IAAI;IAJjC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC;IAC7B,OAAO,CAAC,KAAK,CAAoC;gBAEpB,IAAI,EAAE,GAAG;IAKtC,qFAAqF;IACrF,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS;IAK9C,IAAI,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM;IAI7B,qFAAqF;IACrF,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE;IAgBjD,kDAAkD;IAClD,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS;IAKtC,OAAO,IAAI,MAAM,EAAE;CAIpB"}
package/dist/docs.js ADDED
@@ -0,0 +1,92 @@
1
+ // The documents the server reads, and the spec's rules.
2
+ //
3
+ // llms.txt at the repository root is the index: only the files it links to can be read or searched, so a
4
+ // tool call can't reach anything else on disk. Rules are the `- **[ID]**` bullets of
5
+ // docs/provider-standard.md, each with the section it belongs to.
6
+ import { readFileSync } from "node:fs";
7
+ const RAW = "https://raw.githubusercontent.com/AlgoriaLabs/stellar-agent-services/main/";
8
+ const SPEC = "docs/provider-standard.md";
9
+ const RULE = /^- \*\*\[([A-Z]\d+)\]\*\*\s*(.*)$/;
10
+ export class Docs {
11
+ root;
12
+ index;
13
+ entries;
14
+ rules;
15
+ constructor(root) {
16
+ this.root = root;
17
+ this.index = readFileSync(new URL("llms.txt", root), "utf8");
18
+ this.entries = parseIndex(this.index);
19
+ }
20
+ /** The entry for a repository path or its raw GitHub URL, when llms.txt lists it. */
21
+ entry(pathOrUrl) {
22
+ const path = (pathOrUrl.startsWith(RAW) ? pathOrUrl.slice(RAW.length) : pathOrUrl).replace(/^\.?\//, "");
23
+ return this.entries.find((entry) => entry.path === path);
24
+ }
25
+ read(entry) {
26
+ return readFileSync(new URL(entry.path, this.root), "utf8");
27
+ }
28
+ /** Lines containing every term of the query, case-insensitive, in llms.txt order. */
29
+ search(query, limit) {
30
+ const terms = query.toLowerCase().split(/\s+/).filter(Boolean);
31
+ const hits = [];
32
+ if (terms.length === 0)
33
+ return hits;
34
+ for (const entry of this.entries) {
35
+ const lines = this.read(entry).split("\n");
36
+ for (const [index, text] of lines.entries()) {
37
+ const lower = text.toLowerCase();
38
+ if (!terms.every((term) => lower.includes(term)))
39
+ continue;
40
+ hits.push({ path: entry.path, line: index + 1, text: text.trim() });
41
+ if (hits.length >= limit)
42
+ return hits;
43
+ }
44
+ }
45
+ return hits;
46
+ }
47
+ /** A spec rule by id: "J13", "[J13]" or "j13". */
48
+ rule(id) {
49
+ this.rules ??= parseRules(readFileSync(new URL(SPEC, this.root), "utf8"));
50
+ return this.rules.get(id.replace(/[[\]\s]/g, "").toUpperCase());
51
+ }
52
+ ruleIds() {
53
+ this.rules ??= parseRules(readFileSync(new URL(SPEC, this.root), "utf8"));
54
+ return [...this.rules.keys()];
55
+ }
56
+ }
57
+ function parseIndex(index) {
58
+ const entries = [];
59
+ let section = "";
60
+ for (const line of index.split("\n")) {
61
+ if (line.startsWith("## "))
62
+ section = line.slice(3).trim();
63
+ const link = /^- \[([^\]]+)\]\(([^)]+)\)(?::\s*(.*))?$/.exec(line);
64
+ if (link === null || !link[2].startsWith(RAW))
65
+ continue;
66
+ entries.push({ path: link[2].slice(RAW.length), title: link[1], summary: link[3] ?? "", section });
67
+ }
68
+ return entries;
69
+ }
70
+ function parseRules(spec) {
71
+ const rules = new Map();
72
+ let section = "";
73
+ let current;
74
+ for (const line of spec.split("\n")) {
75
+ const heading = /^#{2,4} (.*)$/.exec(line);
76
+ if (heading !== null)
77
+ section = heading[1].trim();
78
+ const rule = RULE.exec(line);
79
+ if (rule !== null) {
80
+ current = { id: rule[1], section, text: rule[2] };
81
+ rules.set(current.id, current);
82
+ }
83
+ else if (current !== undefined && line.startsWith(" ") && line.trim() !== "") {
84
+ current.text += ` ${line.trim()}`;
85
+ }
86
+ else {
87
+ current = undefined;
88
+ }
89
+ }
90
+ return rules;
91
+ }
92
+ //# sourceMappingURL=docs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs.js","sourceRoot":"","sources":["../src/docs.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,yGAAyG;AACzG,qFAAqF;AACrF,kEAAkE;AAElE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,GAAG,GAAG,4EAA4E,CAAC;AACzF,MAAM,IAAI,GAAG,2BAA2B,CAAC;AACzC,MAAM,IAAI,GAAG,mCAAmC,CAAC;AAwBjD,MAAM,OAAO,IAAI;IAKc;IAJpB,KAAK,CAAS;IACd,OAAO,CAAa;IACrB,KAAK,CAAoC;IAEjD,YAA6B,IAAS;QAAT,SAAI,GAAJ,IAAI,CAAK;QACpC,IAAI,CAAC,KAAK,GAAG,YAAY,CAAC,IAAI,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;QAC7D,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;IAED,qFAAqF;IACrF,KAAK,CAAC,SAAiB;QACrB,MAAM,IAAI,GAAG,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QACzG,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IAC3D,CAAC;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CAAC;AAED,SAAS,UAAU,CAAC,IAAY;IAC9B,MAAM,KAAK,GAAG,IAAI,GAAG,EAAoB,CAAC;IAC1C,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,IAAI,OAA6B,CAAC;IAClC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACpC,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,OAAO,KAAK,IAAI;YAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAE,CAAC,IAAI,EAAE,CAAC;QACnD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7B,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAClB,OAAO,GAAG,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC,CAAE,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAE,EAAE,CAAC;YACpD,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QACjC,CAAC;aAAM,IAAI,OAAO,KAAK,SAAS,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YAChF,OAAO,CAAC,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;QACpC,CAAC;aAAM,CAAC;YACN,OAAO,GAAG,SAAS,CAAC;QACtB,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ // The MCP server over stdio. Everything is in server.ts; this only connects it to the process.
3
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
+ import { createServer } from "./server.js";
5
+ await createServer().connect(new StdioServerTransport());
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,+FAA+F;AAE/F,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,YAAY,EAAE,CAAC,OAAO,CAAC,IAAI,oBAAoB,EAAE,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { type VerifyOptions } from "@stellar-agent-services/verifier";
3
+ export declare const SERVER: {
4
+ readonly name: "stellar-agent-services";
5
+ readonly version: string;
6
+ };
7
+ export interface ServerOptions {
8
+ /** The repository the documents are read from. Default: the clone this server is built in. */
9
+ root?: URL;
10
+ /** Passed to verifyProvider() by check_provider, such as an offline provider's fetch in tests. Never a payer. */
11
+ verify?: Omit<Partial<VerifyOptions>, "payer">;
12
+ }
13
+ export declare function createServer(options?: ServerOptions): McpServer;
14
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,OAAO,EAA8D,KAAK,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAOlI,eAAO,MAAM,MAAM;;;CAAuD,CAAC;AAO3E,MAAM,WAAW,aAAa;IAC5B,8FAA8F;IAC9F,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,iHAAiH;IACjH,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC,CAAC;CAChD;AAED,wBAAgB,YAAY,CAAC,OAAO,GAAE,aAAkB,GAAG,SAAS,CAmHnE"}
package/dist/server.js ADDED
@@ -0,0 +1,125 @@
1
+ // The MCP server for coding agents that build on Provider Standard v1.
2
+ //
3
+ // Tools:
4
+ // list_docs the documentation index (llms.txt)
5
+ // read_doc one document from that index
6
+ // search_docs lines of the indexed documents that contain every term of a query
7
+ // get_spec_rule a rule of the standard by id, such as J13
8
+ // validate_manifest check C1 on a manifest document that is not served yet
9
+ // check_provider `verifier check` on a running provider: C1, C2, C3, C6 and C7's unpaid burst
10
+ //
11
+ // It holds no key and never pays: check_provider runs without a test payer, so the paid checks (C4, C5)
12
+ // are always skipped. The documents are read from the clone the server is built in, or, installed from npm, from the
13
+ // copy of them packed with it (scripts/pack-docs.mjs).
14
+ import { existsSync, readFileSync } from "node:fs";
15
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
16
+ import { PROVIDER_STANDARD } from "@stellar-agent-services/protocol";
17
+ import { checkManifestDocument, InvalidOptionsError, verifyProvider } from "@stellar-agent-services/verifier";
18
+ import { z } from "zod/v4";
19
+ import { Docs } from "./docs.js";
20
+ const PACKAGE = new URL("../", import.meta.url);
21
+ const { version } = JSON.parse(readFileSync(new URL("package.json", PACKAGE), "utf8"));
22
+ export const SERVER = { name: "stellar-agent-services", version };
23
+ /** The clone this file is built in (dist/ is two levels below it), or else the documents packed in repository/. */
24
+ const CLONE = new URL("../../../", import.meta.url);
25
+ const REPOSITORY = existsSync(new URL("packages/dev-mcp/package.json", CLONE)) ? CLONE : new URL("repository/", PACKAGE);
26
+ const MAX_SEARCH_HITS = 50;
27
+ export function createServer(options = {}) {
28
+ const docs = new Docs(options.root ?? REPOSITORY);
29
+ const server = new McpServer(SERVER, {
30
+ instructions: `Tools for building on ${PROVIDER_STANDARD}, the standard for paid AI services on Stellar. ` +
31
+ "Start with read_doc on AGENTS.md to pick a path. Cite spec rules by id and look them up with get_spec_rule. " +
32
+ "Check a manifest with validate_manifest while writing it, and a running provider with check_provider. Nothing here pays.",
33
+ });
34
+ server.registerTool("list_docs", {
35
+ title: "List documents",
36
+ description: "The documentation index (llms.txt): every guide, reference and schema, with a one-line summary. read_doc takes any path it lists.",
37
+ annotations: { readOnlyHint: true, openWorldHint: false },
38
+ }, async () => text(docs.index));
39
+ server.registerTool("read_doc", {
40
+ title: "Read a document",
41
+ description: "Reads one document listed by list_docs, by repository path (such as docs/provider-standard.md or AGENTS.md) or by its llms.txt URL.",
42
+ inputSchema: { path: z.string().describe("Repository path or llms.txt URL") },
43
+ annotations: { readOnlyHint: true, openWorldHint: false },
44
+ }, async ({ path }) => {
45
+ const entry = docs.entry(path);
46
+ if (entry === undefined)
47
+ return error(`${path} is not in the index. Paths you can read:\n${docs.entries.map((known) => known.path).join("\n")}`);
48
+ return text(docs.read(entry));
49
+ });
50
+ server.registerTool("search_docs", {
51
+ title: "Search the documents",
52
+ description: "Finds lines that contain every term of the query, case-insensitive, across the indexed documents. Returns path:line and the line.",
53
+ inputSchema: {
54
+ query: z.string().min(1).describe("Terms, such as \"payment_uncertain reconcile\""),
55
+ limit: z.number().int().min(1).max(MAX_SEARCH_HITS).optional().describe(`Most hits to return (default 20, at most ${MAX_SEARCH_HITS})`),
56
+ },
57
+ annotations: { readOnlyHint: true, openWorldHint: false },
58
+ }, async ({ query, limit }) => {
59
+ const hits = docs.search(query, limit ?? 20);
60
+ if (hits.length === 0)
61
+ return text(`No line contains every term of "${query}".`);
62
+ return text(hits.map((hit) => `${hit.path}:${hit.line}: ${hit.text}`).join("\n"));
63
+ });
64
+ server.registerTool("get_spec_rule", {
65
+ title: "Get a spec rule",
66
+ description: "The full text of a Provider Standard v1 rule by id, such as M5, P7, J13 or Q1, with its section. Prefixes: M manifest, S services, P payment, J jobs, Q capacity, E errors, I identity, X extensions.",
67
+ inputSchema: { id: z.string().describe("Rule id, such as J13 or [J13]") },
68
+ annotations: { readOnlyHint: true, openWorldHint: false },
69
+ }, async ({ id }) => {
70
+ const rule = docs.rule(id);
71
+ if (rule === undefined)
72
+ return error(`No rule ${id}. Rules: ${docs.ruleIds().join(", ")}`);
73
+ return text(`[${rule.id}] (docs/provider-standard.md, ${rule.section})\n${rule.text}`);
74
+ });
75
+ server.registerTool("validate_manifest", {
76
+ title: "Validate a manifest",
77
+ description: "Runs check C1 on a manifest document before it is served: the JSON Schema [M9], the rules JSON Schema can't express (M3, M5, M7, S6, S9, P11), the service schemas, and SHOULD rules. Serving rules (status, Content-Type, redirects, Cache-Control) need check_provider on the running provider.",
78
+ inputSchema: {
79
+ manifest: z.string().describe("The manifest's JSON text"),
80
+ manifestUrl: z.string().optional().describe("Where it will be served. Default: /.well-known/stellar-agent-services.json on the origin of its baseUrl"),
81
+ dev: z.boolean().optional().describe("Accept a loopback http:// provider [M6]"),
82
+ },
83
+ annotations: { readOnlyHint: true, openWorldHint: false },
84
+ }, async ({ manifest, manifestUrl, dev }) => {
85
+ const result = await checkManifestDocument(manifest, { ...(manifestUrl === undefined ? {} : { manifestUrl }), dev: dev ?? false });
86
+ return text(`${describe(result)}\n\n${JSON.stringify(result, null, 2)}`);
87
+ });
88
+ server.registerTool("check_provider", {
89
+ title: "Check a running provider",
90
+ description: "Runs `verifier check` on a provider's manifest URL: C1 manifest, C2 identity, C3 challenge, C6 hygiene and an unpaid load burst (C7, 20 requests). It never pays, so C4 and C5 are skipped. Sends requests to the provider.",
91
+ inputSchema: {
92
+ manifestUrl: z.string().describe("Such as https://api.example.com/.well-known/stellar-agent-services.json"),
93
+ dev: z.boolean().optional().describe("Accept a provider on http://localhost [M6]"),
94
+ service: z.string().optional().describe("The service to probe and load. Default: the cheapest one with an example"),
95
+ },
96
+ annotations: { readOnlyHint: true, openWorldHint: true },
97
+ }, async ({ manifestUrl, dev, service }) => {
98
+ const { payer: _never, ...overrides } = (options.verify ?? {});
99
+ try {
100
+ const report = await verifyProvider({ ...overrides, manifestUrl, dev: dev ?? false, ...(service === undefined ? {} : { service }) });
101
+ const lines = report.results.map(describe);
102
+ lines.push("", `Level ${report.level}, score ${report.score} of 100. Paid checks (C4, C5) need \`verifier verify --pay\` with a funded testnet payer.`);
103
+ return text(`${lines.join("\n")}\n\n${JSON.stringify(report, null, 2)}`);
104
+ }
105
+ catch (caught) {
106
+ if (caught instanceof InvalidOptionsError)
107
+ return error(caught.message);
108
+ throw caught;
109
+ }
110
+ });
111
+ return server;
112
+ }
113
+ /** One line for a check, then its findings. */
114
+ function describe(result) {
115
+ const head = `${result.status === "passed" ? "✓" : result.status === "failed" ? "✗" : "-"} ${result.check} ${result.status}${result.reason === undefined ? "" : `: ${result.reason}`}`;
116
+ const findings = (result.findings ?? []).map((finding) => ` ${finding.severity} [${finding.rule}] ${finding.message}`);
117
+ return [head, ...findings].join("\n");
118
+ }
119
+ function text(value) {
120
+ return { content: [{ type: "text", text: value }] };
121
+ }
122
+ function error(value) {
123
+ return { content: [{ type: "text", text: value }], isError: true };
124
+ }
125
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,EAAE;AACF,SAAS;AACT,0DAA0D;AAC1D,oDAAoD;AACpD,yFAAyF;AACzF,iEAAiE;AACjE,8EAA8E;AAC9E,oGAAoG;AACpG,EAAE;AACF,wGAAwG;AACxG,qHAAqH;AACrH,uDAAuD;AAEvD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,iBAAiB,EAAoB,MAAM,kCAAkC,CAAC;AACvF,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,cAAc,EAAsB,MAAM,kCAAkC,CAAC;AAClI,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM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G,MAAM,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;IACvL,MAAM,QAAQ,GAAG,CAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAC1H,OAAO,CAAC,IAAI,EAAE,GAAG,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACxC,CAAC;AAED,SAAS,IAAI,CAAC,KAAa;IACzB,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;AACtD,CAAC;AAED,SAAS,KAAK,CAAC,KAAa;IAC1B,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACrE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,42 @@
1
1
  {
2
2
  "name": "@stellar-agent-services/dev-mcp",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "MCP server for coding agents building on Provider Standard v1: spec rules, docs, manifest validation and unpaid provider checks. It never pays.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/AlgoriaLabs/stellar-agent-services.git",
10
+ "directory": "packages/dev-mcp"
11
+ },
12
+ "engines": {
13
+ "node": ">=22.13"
14
+ },
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/server.d.ts",
18
+ "default": "./dist/server.js"
19
+ }
20
+ },
21
+ "files": [
22
+ "dist",
23
+ "repository",
24
+ "!dist/.tsbuildinfo"
25
+ ],
26
+ "scripts": {
27
+ "build": "tsc -b",
28
+ "prepack": "node scripts/pack-docs.mjs"
29
+ },
30
+ "bin": {
31
+ "stellar-agent-services-mcp": "./dist/index.js"
32
+ },
33
+ "dependencies": {
34
+ "@modelcontextprotocol/sdk": "1.32.1",
35
+ "@stellar-agent-services/protocol": "0.1.1",
36
+ "@stellar-agent-services/verifier": "0.1.1",
37
+ "zod": "3.25.76"
38
+ },
39
+ "devDependencies": {
40
+ "@stellar-agent-services/provider-kit": "0.1.1"
41
+ }
42
+ }
@@ -0,0 +1,162 @@
1
+ # AGENTS.md
2
+
3
+ Instructions for AI coding agents. Read this first, pick one path in §2, then follow the reference it names.
4
+ People should start with [README.md](README.md).
5
+
6
+ ## 1. What this is
7
+
8
+ **Provider Standard v1** (`stellar-agent-services/provider@1`) is an open standard for paid AI services on
9
+ Stellar. A provider publishes a manifest at `/.well-known/stellar-agent-services.json` that describes its services,
10
+ prices and schemas. A client pays per job in USDC through x402 v2 (`exact` scheme). If the client loses the
11
+ response, it collects the result again without paying twice.
12
+
13
+ This repository holds the standard and everything needed to use it:
14
+
15
+ | Piece | Path | What it is |
16
+ | --- | --- | --- |
17
+ | The standard | [docs/provider-standard.md](docs/provider-standard.md) | Normative. Rules have ids such as `[M5]` and `[J13]`. |
18
+ | Protocol | [packages/protocol](packages/protocol) | The standard as TypeScript with no runtime dependencies, plus JSON Schemas and test vectors |
19
+ | Provider Kit | [packages/provider-kit](packages/provider-kit) | Library (`defineService`, `createProvider`), gateway for an existing API, `provider-kit` CLI |
20
+ | Payment client | [packages/payment-client](packages/payment-client) | Buyer side: approval, spending policy, journal, payment, recovery. `stellar-pay` CLI. |
21
+ | Verifier | [packages/verifier](packages/verifier) | Checks a provider against the standard (C1–C7), issues receipts and badges. `verifier watch` answers validation requests by itself. |
22
+ | MCP server | [packages/dev-mcp](packages/dev-mcp) | Spec rules, docs, manifest validation and provider checks as MCP tools. It never pays. |
23
+ | Scaffolder | [packages/create-stellar-service](packages/create-stellar-service) | `npm create stellar-service`: a new project around an existing API, a TypeScript service or a Python service, ready to run, try and deploy |
24
+ | Agent Wallet | [apps/wallet](apps/wallet) | Web page where a person approves and pays |
25
+ | Examples | [examples/paid-service](examples/paid-service), [examples/python-upstream](examples/python-upstream) | A TypeScript provider, and a Python API behind the gateway |
26
+
27
+ Facts to get right:
28
+
29
+ - **Networks:** `stellar:testnet` and `stellar:pubnet`. Everything here is developed and tested on testnet.
30
+ - **Asset:** USDC only. Take its contract address from `USDC_ASSET[network]` in `@stellar-agent-services/protocol`
31
+ instead of retyping it.
32
+ - **Facilitator:** `https://x402.org/facilitator` on testnet. It verifies and settles payments with sponsored fees.
33
+ On mainnet, OpenZeppelin's `https://channels.openzeppelin.com/x402`, which wants an API key (`FACILITATOR_AUTH`).
34
+ - **Identity:** a provider registers in the Stellar 8004 identity registry. Its `agentId` goes in the manifest, and
35
+ its registered wallet must equal `payTo` (`[I1]`–`[I3]`).
36
+ - **Node.js 22.13 or later.** `.node-version` pins 24.
37
+
38
+ ## 2. Pick a path
39
+
40
+ | You want to… | Path | Read | Done when |
41
+ | --- | --- | --- | --- |
42
+ | Build a **new paid service** in TypeScript (Node, Workers, Deno, Bun) | Kit library. `create-stellar-service --kind typescript` makes the project. | [docs/standard/README-AI.md §2](docs/standard/README-AI.md#2-kit-path-typescript), [provider-setup-guide.md §3b](docs/provider-setup-guide.md#3b-typescript-library-a-new-service), template [examples/paid-service](examples/paid-service) | `provider-kit check --manifest <url> --dev` and `verifier check <url> --dev` pass |
43
+ | Make an **existing HTTP API** paid, in any language | Gateway: a JSON config, no code. `provider-kit init --openapi <url>` writes it from the API's OpenAPI document; `create-stellar-service --kind wrap` makes a whole project around it. | [provider-setup-guide.md §3a](docs/provider-setup-guide.md#3a-gateway-an-existing-api), [packages/provider-kit](packages/provider-kit#gateway-mode), [examples/python-upstream](examples/python-upstream) | `provider-kit check --config provider.config.json` passes and the gateway starts |
44
+ | Implement the standard in **another language** | Native | [docs/standard/README-AI.md §3–§13](docs/standard/README-AI.md), the [spec](docs/provider-standard.md), the [test vectors](packages/protocol/test-vectors) | Every test vector passes, and `verifier check <url>` passes |
45
+ | Build an **agent, wallet or app that pays** providers | Client: an adapter for `payment-client`, or your own client | [docs/client-integration/README-AI.md](docs/client-integration/README-AI.md), spec §14 rules in [docs/standard/README-AI.md](docs/standard/README-AI.md#14-client-rules-agents-wallets-apps) | The conformance checks in `@stellar-agent-services/payment-client/conformance` pass, or for a native client the client rules hold |
46
+ | **Verify** a provider, or get one verified | Verifier | [docs/verification.md](docs/verification.md), [packages/verifier](packages/verifier), [provider-setup-guide.md §7–§9](docs/provider-setup-guide.md#7-go-live-provider-kit-launch) | `verifier check` passes; with a funded test payer, `verifier verify --pay` reaches the level you need |
47
+ | **Change this repository** | Contributor | §6 below, [CONTRIBUTING.md](CONTRIBUTING.md), and for recovery code [docs/recovery/README-AI.md](docs/recovery/README-AI.md) | `npm run typecheck` and `npm test` pass |
48
+
49
+ Follow one path. Don't mix the Kit with a hand-written job flow.
50
+
51
+ ## 3. Use the packages from another project
52
+
53
+ The packages are on npm, all at one version:
54
+
55
+ ```bash
56
+ npm create stellar-service my-service -- --kind wrap|typescript|python # a new project, ready to run
57
+ npm install @stellar-agent-services/provider-kit # a provider in your own project
58
+ npm install @stellar-agent-services/payment-client # an agent or app that pays
59
+ npx @stellar-agent-services/verifier check <url> # also provider-kit, and stellar-pay (payment-client)
60
+ ```
61
+
62
+ `npm create stellar-service` makes a project around the kit: it installs it and writes `.env`, a Dockerfile, `fly.toml`
63
+ and npm scripts: `dev` (runs it, paid to a throwaway testnet account, so no wallet is needed), `try`, `check`,
64
+ `status`, `launch` (goes live) and `deploy`. Pass every answer as a flag (`--openapi`, `--upstream`, `--description`,
65
+ `--price`): without a terminal it asks nothing. `--network mainnet` makes a project that takes real USDC: use it only
66
+ when the user asked for mainnet. Such a project has no `try`, since mainnet has no test money: build and try it on
67
+ testnet first.
68
+
69
+ Installing the kit into a project of your own, add the override `create-stellar-service` writes to its
70
+ `package.json`, which keeps one copy of the Stellar SDK: `"overrides": { "@trionlabs/stellar8004": {
71
+ "@stellar/stellar-sdk": "16.4.1" } }` ([provider-kit README](packages/provider-kit/README.md)).
72
+
73
+ `npm run launch` (`provider-kit launch`) opens an approval page in the user's browser, where their wallet signs the
74
+ trustline, the 8004 registration and a validation request in one go, and it may deploy to Fly.io. Ask the user
75
+ first, run it with `--no-open`, and give them the link. `provider-kit status --json` tells you where a provider stands
76
+ and the one command to run next.
77
+
78
+ A native implementation needs no package: it needs the spec, `packages/protocol/schemas/manifest.schema.json` and
79
+ the test vectors. Changes not released yet run from a clone (`npm install && npm run build`): there,
80
+ `node packages/create-stellar-service/dist/index.js` packs the clone's kit into the new project's `vendor/` folder.
81
+
82
+ **Tools for coding agents.** In Claude Code, `/plugin marketplace add AlgoriaLabs/stellar-agent-services` and then
83
+ `/plugin install stellar-agent-services@stellar-agent-services` add skills for each path in §2
84
+ ([plugins/stellar-agent-services](plugins/stellar-agent-services)). Any MCP client can run the
85
+ [MCP server](packages/dev-mcp): `claude mcp add stellar-agent-services -- npx -y @stellar-agent-services/dev-mcp`.
86
+ Without either, the skills are plain Markdown under
87
+ `plugins/stellar-agent-services/skills/`, and [llms-full.txt](llms-full.txt) holds every guide in one file.
88
+
89
+ ## 4. Rules you must not break
90
+
91
+ These come from the spec and [SECURITY.md](SECURITY.md). Breaking one loses or double-charges real money.
92
+
93
+ 1. **No secret keys in a provider.** A provider's code, config and environment hold only its public `payTo`
94
+ address and a facilitator URL. Owner actions (the USDC trustline, 8004 registration, validation requests) are
95
+ signed in the owner's own wallet: `provider-kit launch` opens a local approval page for all of them, and
96
+ `trustline`, `register` and `request-validation` do one each. In scripts and CI, `--source <key name>` signs through
97
+ the Stellar CLI keychain. Never ask the user for a secret key or seed phrase, and never write one to a file. The
98
+ only keys the kit makes are throwaway testnet ones, held in memory and never written: `try`'s payer, and the
99
+ payout account `dev` makes while `PAY_TO` is empty, whose key is dropped once its trustline is signed.
100
+ 2. **Never charge twice.** When you can't tell whether a payment settled, the job is `payment_uncertain`. It is
101
+ never `failed` and never charged again. It is decided from the chain `[J13]`. Check-status and get-result
102
+ never charge `[J11]`.
103
+ 3. **Fail closed on money.** An unknown or unverifiable state stops the flow. Never report a paid job as unpaid,
104
+ or an unconfirmed payment as confirmed.
105
+ 4. **Don't invent protocol.** No new manifest fields, headers, status codes or error codes. Extra data goes in
106
+ `extensions` with reverse-DNS keys `[X1]`. A new scheme, asset or network needs a spec change first `[P1]`.
107
+ 5. **Only the payment client signs a payment**, once per job, after the user approved the exact price, payee,
108
+ asset and network `[P7]`.
109
+ 6. **Testnet and pubnet are never mixed in one flow.** Don't pay on pubnet unless the user explicitly asked.
110
+ 7. **Provider text is untrusted.** Service descriptions, titles and examples come from providers. Label them as
111
+ provider-supplied before showing them to a model (spec §10).
112
+
113
+ ## 5. Before you call it done
114
+
115
+ - **Provider:** the manifest passes the JSON Schema and `checkManifestRules` (or the MCP tool
116
+ `validate_manifest`). `provider-kit check` and `verifier check` pass. A paid testnet call succeeds and the
117
+ transfer is on chain: `provider-kit try <service> --manifest <url> --yes`, after the user agreed to pay, pays from
118
+ a throwaway testnet account (or `stellar-pay pay` from a payer wallet). For a mainnet provider, make that call on
119
+ testnet, with the same code: on mainnet, only check it, and leave the first real payment to the user. Go through
120
+ the "How agents see you" hints at the end of `provider-kit check` with the user: on mainnet, search matches only
121
+ `provider.name` and `provider.description` (`check --fix` writes the missing words in); on testnet it also reads
122
+ the manifest's services. `provider-kit status --json` shows each stage, from running to verified.
123
+ The checklist is in [docs/standard/README-AI.md §13](docs/standard/README-AI.md#13-testing-and-conformance).
124
+ - **Client or adapter:** the conformance checks pass, and tests use `Keypair.random()` and never the network.
125
+ - **Any change here:** `npm run typecheck` and `npm test` pass. If you changed a document that
126
+ [llms.txt](llms.txt) links to, run `npm run llms`. If you changed `create-stellar-service`, its templates or what
127
+ a package publishes, `npm run scaffold:check` (for each kind and network you touched) and `npm run packages:check`
128
+ pass too.
129
+
130
+ Cite spec rules by id in code comments, findings and error messages, as the existing code does.
131
+
132
+ ## 6. Working in this repository
133
+
134
+ ```bash
135
+ npm install
136
+ npm run typecheck # tsc -b over every package
137
+ npm test # vitest, the whole workspace, offline
138
+ npm run llms # rebuild llms-full.txt after a doc change (CI checks it)
139
+
140
+ npm run build && npm run packages:check # what each npm package would publish
141
+ npm run scaffold:check -- --kind typescript --network mainnet # a new project: made, built, started, verified
142
+ npm run packages:rehearse # publish to a throwaway local registry, then install and use the packages
143
+ npm run live:check # read-only checks against the live networks: facilitators, RPC, registries
144
+ ```
145
+
146
+ - **CI** runs all of these on every pull request except `live:check`, which runs daily
147
+ ([CONTRIBUTING.md](CONTRIBUTING.md#what-ci-checks)). The project checks and the rehearsal install from the npm
148
+ registry, and `live:check` reads the live networks. None of them signs or pays. A release is a version tag
149
+ ([CONTRIBUTING.md](CONTRIBUTING.md#releasing)).
150
+
151
+ - **Order of change:** the spec is the product. A new behavior becomes a spec rule first
152
+ ([docs/provider-standard.md](docs/provider-standard.md)), then the Kit and the payment client, then a verifier
153
+ check that fails a provider breaking it. v1 is frozen and only gains optional fields and SHOULD rules.
154
+ - **Tests never touch the network.** Providers in tests use `rpc: false` or a fake `ChainReader`. Payments are signed
155
+ offline (`@stellar-agent-services/provider-kit/testing`). Shared harnesses are in each package's `test/support/`.
156
+ - **`packages/protocol` has no runtime dependencies** and never imports signing code. The read-only discovery
157
+ service depends on it.
158
+ - **Style:** TypeScript strict, ES modules, `.js` import suffixes, exact dependency versions. Each file starts
159
+ with a comment that says what it does. Documents use short, plain sentences and wrap at about 115 characters.
160
+ - **Layout:** `packages/<name>/src`, `packages/<name>/test`, one README per package with a file table. Find the file
161
+ map in each package README before you search.
162
+ - Don't commit `.env` files, keys, journals or job databases (`.gitignore` covers them).