@teeras/afterhours-mcp 0.1.0

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.
package/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # Teeras Afterhours MCP
2
+
3
+ Connect an account first with `npx @teeras/afterhours`. Activity tools refuse
4
+ to scan local agent histories until that Google-backed Teeras connection exists.
5
+
6
+ An optional, read-only local MCP adapter for Teeras Afterhours.
7
+
8
+ ```json
9
+ {
10
+ "mcpServers": {
11
+ "afterhours": {
12
+ "command": "npx",
13
+ "args": ["-y", "@teeras/afterhours-mcp"]
14
+ }
15
+ }
16
+ }
17
+ ```
18
+
19
+ It gives a coding agent three local tools:
20
+
21
+ - `afterhours_week` — the human's current AI-life balance and one boundary
22
+ - `afterhours_sources` — detected coding-agent apps and data fidelity
23
+ - `afterhours_privacy` — the exact retained/never-retained contract
24
+
25
+ The MCP server does not expose prompt text, code, outputs, repositories, working
26
+ directories, or file paths. It has no write tools and makes no network or LLM
27
+ calls. The collector remains independently useful without MCP.
package/dist/cli.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
package/dist/cli.js ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
3
+ import { createAfterhoursServer } from "./server.js";
4
+ const server = createAfterhoursServer();
5
+ const transport = new StdioServerTransport();
6
+ await server.connect(transport);
7
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD,MAAM,MAAM,GAAG,sBAAsB,EAAE,CAAC;AACxC,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { createAfterhoursServer } from "./server.js";
2
+ export { afterhoursPrivacy, afterhoursSources, afterhoursWeek, type WeekResult } from "./tools.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,cAAc,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { createAfterhoursServer } from "./server.js";
2
+ export { afterhoursPrivacy, afterhoursSources, afterhoursWeek } from "./tools.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,cAAc,EAAmB,MAAM,YAAY,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ export declare function createAfterhoursServer(): McpServer;
3
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAQpE,wBAAgB,sBAAsB,IAAI,SAAS,CAkClD"}
package/dist/server.js ADDED
@@ -0,0 +1,25 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { z } from "zod";
3
+ import { afterhoursPrivacy, afterhoursSources, afterhoursWeek } from "./tools.js";
4
+ function text(value) {
5
+ return { content: [{ type: "text", text: JSON.stringify(value, null, 2) }] };
6
+ }
7
+ export function createAfterhoursServer() {
8
+ const server = new McpServer({ name: "teeras-afterhours", version: "0.1.0" });
9
+ server.registerTool("afterhours_week", {
10
+ description: "Read the human's private local AI-life-balance report. Use it to protect their stop time and reduce needless supervision—not to optimize them for more work.",
11
+ inputSchema: {
12
+ stopHour: z.number().int().min(18).max(23).optional().describe("The human's local planned stop hour."),
13
+ },
14
+ }, ({ stopHour }) => text(afterhoursWeek(stopHour)));
15
+ server.registerTool("afterhours_sources", {
16
+ description: "List locally detected coding-agent apps and the fidelity available from each source.",
17
+ inputSchema: {},
18
+ }, () => text(afterhoursSources()));
19
+ server.registerTool("afterhours_privacy", {
20
+ description: "Read the immutable local data boundary: what Afterhours retains and never retains.",
21
+ inputSchema: {},
22
+ }, () => text(afterhoursPrivacy()));
23
+ return server;
24
+ }
25
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAElF,SAAS,IAAI,CAAC,KAAc;IAC1B,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AACxF,CAAC;AAED,MAAM,UAAU,sBAAsB;IACpC,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;IAE9E,MAAM,CAAC,YAAY,CACjB,iBAAiB,EACjB;QACE,WAAW,EACT,8JAA8J;QAChK,WAAW,EAAE;YACX,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;SACvG;KACF,EACD,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CACjD,CAAC;IAEF,MAAM,CAAC,YAAY,CACjB,oBAAoB,EACpB;QACE,WAAW,EAAE,sFAAsF;QACnG,WAAW,EAAE,EAAE;KAChB,EACD,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAChC,CAAC;IAEF,MAAM,CAAC,YAAY,CACjB,oBAAoB,EACpB;QACE,WAAW,EAAE,oFAAoF;QACjG,WAAW,EAAE,EAAE;KAChB,EACD,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAChC,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { detectCodingAgents, type AfterhoursReport, type AfterhoursSnapshot } from "@teeras/afterhours";
2
+ export interface WeekResult {
3
+ report: AfterhoursReport;
4
+ generatedAt: string;
5
+ note: string;
6
+ }
7
+ export declare function afterhoursWeek(stopHour?: number): WeekResult;
8
+ export declare function afterhoursSources(): {
9
+ generatedAt: string;
10
+ sources: Array<Pick<AfterhoursSnapshot["sources"][number], "id" | "name" | "configured" | "fidelity" | "sessions">>;
11
+ detected: ReturnType<typeof detectCodingAgents>;
12
+ };
13
+ export declare function afterhoursPrivacy(): AfterhoursSnapshot["boundary"];
14
+ //# sourceMappingURL=tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kBAAkB,EAGlB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,oBAAoB,CAAC;AAQ5B,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,gBAAgB,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,cAAc,CAAC,QAAQ,SAAK,GAAG,UAAU,CAQxD;AAED,wBAAgB,iBAAiB,IAAI;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY,GAAG,UAAU,GAAG,UAAU,CAAC,CAAC,CAAC;IACpH,QAAQ,EAAE,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;CACjD,CAcA;AAED,wBAAgB,iBAAiB,IAAI,kBAAkB,CAAC,UAAU,CAAC,CAElE"}
package/dist/tools.js ADDED
@@ -0,0 +1,34 @@
1
+ import { collectAfterhours, DATA_BOUNDARY, detectCodingAgents, readCredentials, reportFrom, } from "@teeras/afterhours";
2
+ function requireAccount() {
3
+ if (!readCredentials()) {
4
+ throw new Error("Afterhours needs a Teeras account. Run `npx @teeras/afterhours` once; it opens Google sign-in and returns here automatically.");
5
+ }
6
+ }
7
+ export function afterhoursWeek(stopHour = 22) {
8
+ requireAccount();
9
+ const snapshot = collectAfterhours();
10
+ return {
11
+ report: reportFrom(snapshot, stopHour),
12
+ generatedAt: snapshot.generatedAt,
13
+ note: "Use this to protect the human's boundary, never to rank, shame, or increase output.",
14
+ };
15
+ }
16
+ export function afterhoursSources() {
17
+ requireAccount();
18
+ const snapshot = collectAfterhours();
19
+ return {
20
+ generatedAt: snapshot.generatedAt,
21
+ sources: snapshot.sources.map((source) => ({
22
+ id: source.id,
23
+ name: source.name,
24
+ configured: source.configured,
25
+ fidelity: source.fidelity,
26
+ sessions: source.sessions,
27
+ })),
28
+ detected: detectCodingAgents().filter((agent) => agent.installed),
29
+ };
30
+ }
31
+ export function afterhoursPrivacy() {
32
+ return DATA_BOUNDARY;
33
+ }
34
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,UAAU,GAGX,MAAM,oBAAoB,CAAC;AAE5B,SAAS,cAAc;IACrB,IAAI,CAAC,eAAe,EAAE,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,+HAA+H,CAAC,CAAC;IACnJ,CAAC;AACH,CAAC;AAQD,MAAM,UAAU,cAAc,CAAC,QAAQ,GAAG,EAAE;IAC1C,cAAc,EAAE,CAAC;IACjB,MAAM,QAAQ,GAAG,iBAAiB,EAAE,CAAC;IACrC,OAAO;QACL,MAAM,EAAE,UAAU,CAAC,QAAQ,EAAE,QAAQ,CAAC;QACtC,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC,IAAI,EAAE,qFAAqF;KAC5F,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB;IAK/B,cAAc,EAAE,CAAC;IACjB,MAAM,QAAQ,GAAG,iBAAiB,EAAE,CAAC;IACrC,OAAO;QACL,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YACzC,EAAE,EAAE,MAAM,CAAC,EAAE;YACb,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ;SAC1B,CAAC,CAAC;QACH,QAAQ,EAAE,kBAAkB,EAAE,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC;KAClE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB;IAC/B,OAAO,aAAa,CAAC;AACvB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@teeras/afterhours-mcp",
3
+ "version": "0.1.0",
4
+ "description": "Account-gated MCP tools for private coding-agent usage and AI-life balance.",
5
+ "homepage": "https://teeras.com",
6
+ "keywords": [
7
+ "mcp",
8
+ "coding-agents",
9
+ "ai-life-balance",
10
+ "codex",
11
+ "claude-code",
12
+ "developer-wellbeing"
13
+ ],
14
+ "license": "Apache-2.0",
15
+ "type": "module",
16
+ "bin": {
17
+ "afterhours-mcp": "dist/cli.js"
18
+ },
19
+ "main": "./dist/index.js",
20
+ "types": "./dist/index.d.ts",
21
+ "exports": {
22
+ ".": {
23
+ "types": "./dist/index.d.ts",
24
+ "import": "./dist/index.js"
25
+ }
26
+ },
27
+ "files": [
28
+ "dist",
29
+ "README.md"
30
+ ],
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "engines": {
35
+ "node": ">=20"
36
+ },
37
+ "scripts": {
38
+ "prebuild": "npm run build -w @teeras/afterhours",
39
+ "build": "tsc -p tsconfig.build.json",
40
+ "pretypecheck": "npm run build -w @teeras/afterhours",
41
+ "typecheck": "tsc --noEmit",
42
+ "pretest": "npm run build -w @teeras/afterhours",
43
+ "test": "vitest run"
44
+ },
45
+ "dependencies": {
46
+ "@modelcontextprotocol/sdk": "^1.29.0",
47
+ "@teeras/afterhours": "^0.1.0",
48
+ "zod": "^3.25.76"
49
+ },
50
+ "devDependencies": {
51
+ "@types/node": "^26.1.0",
52
+ "typescript": "^6.0.3",
53
+ "vitest": "^4.1.10"
54
+ }
55
+ }