tempo-api-mcp 2.0.1 → 2.1.3

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/dist/client.js CHANGED
@@ -4,26 +4,60 @@ import { fileURLToPath } from 'url';
4
4
  try {
5
5
  const { config } = await import('dotenv');
6
6
  const __dirname = dirname(fileURLToPath(import.meta.url));
7
- config({ path: join(__dirname, '..', '.env'), override: false });
7
+ config({ path: join(__dirname, '..', '.env'), override: false, quiet: true });
8
8
  }
9
9
  catch {
10
10
  // not available — rely on process.env (mcpb sets credentials via mcp_config.env)
11
11
  }
12
+ /**
13
+ * Read an env var, trim whitespace, and treat as unset if blank or if the value
14
+ * looks like an unsubstituted shell placeholder (e.g. `${FOO}`) — defends
15
+ * against MCP hosts that pass .mcp.json env blocks through unexpanded.
16
+ */
17
+ function readVar(key) {
18
+ const raw = process.env[key];
19
+ if (typeof raw !== 'string')
20
+ return undefined;
21
+ const trimmed = raw.trim();
22
+ if (trimmed.length === 0)
23
+ return undefined;
24
+ if (trimmed === 'undefined' || trimmed === 'null')
25
+ return undefined;
26
+ if (/^\$\{[^}]*\}$/.test(trimmed))
27
+ return undefined;
28
+ return trimmed;
29
+ }
12
30
  const BASE_URL = 'https://api.tempo.io';
13
31
  export class TempoClient {
14
32
  apiToken;
33
+ configError;
34
+ /**
35
+ * Defer the config error so the server can still start (and respond to the
36
+ * host's install-time smoke test) when TEMPO_API_TOKEN isn't set yet.
37
+ * Tool calls re-raise the error at request time.
38
+ */
15
39
  constructor() {
16
- const token = process.env.TEMPO_API_TOKEN;
17
- if (!token)
18
- throw new Error('TEMPO_API_TOKEN environment variable is required');
19
- this.apiToken = token;
40
+ const token = readVar('TEMPO_API_TOKEN');
41
+ if (!token) {
42
+ this.apiToken = null;
43
+ this.configError = new Error('TEMPO_API_TOKEN environment variable is required');
44
+ }
45
+ else {
46
+ this.apiToken = token;
47
+ this.configError = null;
48
+ }
49
+ }
50
+ requireToken() {
51
+ if (this.configError)
52
+ throw this.configError;
53
+ return this.apiToken;
20
54
  }
21
55
  async request(method, path, body, queryParams) {
22
56
  return this.doRequest(method, path, body, queryParams, false);
23
57
  }
24
58
  async doRequest(method, path, body, queryParams, isRetry) {
25
59
  const headers = {
26
- Authorization: `Bearer ${this.apiToken}`,
60
+ Authorization: `Bearer ${this.requireToken()}`,
27
61
  'Content-Type': 'application/json',
28
62
  Accept: 'application/json',
29
63
  };
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import { register as registerTeams } from './tools/teams.js';
8
8
  import { register as registerAccounts } from './tools/accounts.js';
9
9
  import { register as registerProjects } from './tools/projects.js';
10
10
  const client = new TempoClient();
11
- const server = new McpServer({ name: 'tempo-api-mcp', version: '2.0.1' });
11
+ const server = new McpServer({ name: 'tempo-api-mcp', version: '2.1.3' });
12
12
  registerWorklogs(server, client);
13
13
  registerPlans(server, client);
14
14
  registerTeams(server, client);
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "tempo-api-mcp",
3
- "version": "2.0.1",
4
- "description": "Tempo API MCP server for Claude — developed and maintained by AI (Claude Sonnet 4.6)",
5
- "author": "Claude Sonnet 4.6 (AI) <https://www.anthropic.com/claude>",
3
+ "version": "2.1.3",
4
+ "mcpName": "io.github.chrischall/tempo-api-mcp",
5
+ "description": "Tempo API MCP server for Claude developed and maintained by AI (Claude Code)",
6
+ "author": "Claude Code (AI) <https://www.anthropic.com/claude>",
6
7
  "repository": {
7
8
  "type": "git",
8
9
  "url": "git+https://github.com/chrischall/tempo-api-mcp.git"
@@ -13,7 +14,8 @@
13
14
  },
14
15
  "files": [
15
16
  "dist",
16
- "SKILL.md"
17
+ "SKILL.md",
18
+ "server.json"
17
19
  ],
18
20
  "scripts": {
19
21
  "build": "tsc && npm run bundle",
@@ -26,7 +28,7 @@
26
28
  "dependencies": {
27
29
  "@modelcontextprotocol/sdk": "^1.29.0",
28
30
  "dotenv": "^17.4.0",
29
- "zod": "^4.3.6"
31
+ "zod": "^4.4.2"
30
32
  },
31
33
  "devDependencies": {
32
34
  "@types/node": "^25.5.2",
package/server.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
+ "name": "io.github.chrischall/tempo-api-mcp",
4
+ "description": "Tempo time-tracking for Claude — worklogs, plans, and timesheet approvals",
5
+ "repository": {
6
+ "url": "https://github.com/chrischall/tempo-api-mcp",
7
+ "source": "github"
8
+ },
9
+ "version": "2.1.3",
10
+ "packages": [
11
+ {
12
+ "registryType": "npm",
13
+ "identifier": "tempo-api-mcp",
14
+ "version": "2.1.3",
15
+ "transport": {
16
+ "type": "stdio"
17
+ },
18
+ "environmentVariables": [
19
+ {
20
+ "name": "TEMPO_API_TOKEN",
21
+ "description": "Your Tempo API token (Settings → API integration in your Tempo workspace)",
22
+ "isRequired": true,
23
+ "format": "string",
24
+ "isSecret": true
25
+ }
26
+ ]
27
+ }
28
+ ]
29
+ }