Repository navigation
Conversation
) The server sent only the Authorization header to the Taskade API. The bundled HTTP client then added its generic default, "node-fetch". The v1 and the v2 tool setup now send "User-Agent: taskade-mcp-server/<version>". The build inlines the version from package.json into bin/cli.mjs. A unit test asserts the header and the version on a v1 and on a v2 tool call. Closes #100
馃 Changeset detectedLatest commit: 5d89bc6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
馃煝 Approval recommended
The narrowly scoped header change covers both API configurations, has targeted regression tests, and has no identified blocking issues.
No open issues 馃帀
What changed in this PR
Identifies Taskade MCP server API requests with a package-specific, versioned User-Agent, addressing #100.
Changes:
- Adds the User-Agent header to both v1 and v2 tool configurations.
- Adds regression tests checking URLs, authentication, and versioned headers.
- Includes a patch changeset for release.
| File | Description |
|---|---|
| packages/鈥媠erver/鈥媠rc/鈥媠erver.ts | Configures the versioned User-Agent for both APIs. |
| packages/鈥媠erver/鈥媠rc/鈥媠erver.test.ts | Verifies request headers for representative v1 and v2 tools. |
| .changeset/鈥媠erver-user-agent.md | Documents the patch release. |
Review effort: Balanced
|
@deanzaka for review. ImpactEvery request from Request flowBefore: After: All 62 tools (57 v1 + 5 v2) send the header, because the tool runtime merges the server headers into every request. QA
|
Summary
@taskade/mcp-serversent only theAuthorizationheader to the Taskade API. The bundled HTTP client then added its generic default,User-Agent: node-fetch. A request from this package thus looked the same as a request from any Node script.The server now identifies itself on every API request with
User-Agent: taskade-mcp-server/<version>. With this header, Taskade can measure the usage of the package and debug its requests. The header holds no user data and no token.Changes
packages/server/src/server.ts: add'User-Agent': USER_AGENTto the header object of the v1 tool setup and of the v2 tool setup.USER_AGENTistaskade-mcp-server/${version}. The file already importsversionfrompackage.json, and esbuild inlines it intobin/cli.mjsat build time. No file is read at run time.config.headersover the per-request headers on every call ({ ...payload.headers, ...this.config.headers }). Thus all 62 tools send the header, and the generated files do not change.packages/server/src/server.test.ts: a new test connects an MCP client to the server in memory, mocksnode-fetch, and calls one v1 tool and one v2 tool. It asserts the URL, theAuthorizationheader andUser-Agent: taskade-mcp-server/<version>, with the version read frompackage.json..changeset/server-user-agent.md: patch changeset for@taskade/mcp-server.Risk and rollback
Tests
yarn build: pass. The generated tool files did not change, andgit statusshowed only the 3 files of this PR.yarn lint: pass.yarn test: 5 files, 21 tests, all pass (2 new).main(2 of 2) and passes with this change.tsc --noEmit -p packages/server: pass.bin/cli.mjsover stdio, with the API host sent to a local echo server:GET /api/v1/workspaces(workspacesGet)User-Agent: node-fetchUser-Agent: taskade-mcp-server/0.1.2POST /api/v2/promptAgent(promptAgent)User-Agent: node-fetchUser-Agent: taskade-mcp-server/0.1.2tools/listreturned 62 tools before and after. TheAuthorization: Bearer <token>header did not change.packages/server/package.jsonto0.1.3gavevar version = "0.1.3"inbin/cli.mjsafteryarn build:cli. The header thus follows the version that the release workflow writes before it builds.Closes #100