backlog-mcp-server 0.13.0 → 0.13.2

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.
@@ -158,6 +158,18 @@ export const CustomFieldSchema = z.object({
158
158
  required: z.boolean(),
159
159
  applicableIssueTypes: z.array(z.number()),
160
160
  });
161
+ // A custom field *value* attached to an issue (as returned by the Backlog API),
162
+ // as opposed to a custom field *definition* (CustomFieldSchema above). The
163
+ // concrete `value` shape depends on the field type, so it is left unconstrained.
164
+ export const CustomFieldValueSchema = z.object({
165
+ id: z.number(),
166
+ fieldTypeId: CustomFieldTypeSchema,
167
+ name: z.string(),
168
+ value: z.unknown(),
169
+ // Present on "checkbox" / "radio" fields that allow free-text input for an
170
+ // "other" option; holds whatever the user typed there (null when unused).
171
+ otherValue: z.string().nullable().optional(),
172
+ });
161
173
  export const SharedFileSchema = z.object({
162
174
  id: z.number(),
163
175
  projectId: z.number(),
@@ -194,7 +206,7 @@ export const IssueSchema = z.object({
194
206
  created: z.string(),
195
207
  updatedUser: UserSchema,
196
208
  updated: z.string(),
197
- customFields: z.array(CustomFieldSchema),
209
+ customFields: z.array(CustomFieldValueSchema),
198
210
  attachments: z.array(IssueFileInfoSchema),
199
211
  sharedFiles: z.array(SharedFileSchema),
200
212
  stars: z.array(StarSchema),
@@ -1,6 +1,10 @@
1
1
  import { Backlog } from 'backlog-js';
2
2
  import { getCurrentAccessToken } from '../auth/backlogAuthContext.js';
3
3
  import { getCurrentOrganization } from './backlogOrganizationContext.js';
4
+ import packageJson from '../../package.json' with { type: 'json' };
5
+ // Sent as the User-Agent header on Backlog API requests so that traffic
6
+ // originating from this MCP Server can be identified in access logs / observability tooling.
7
+ const USER_AGENT = `backlog-mcp-server/${packageJson.version}`;
4
8
  export function createBacklogClientRegistry(input = {}) {
5
9
  const env = input.env ?? process.env;
6
10
  const multiOrgRegistry = createMultiOrganizationRegistryFromEnv(env);
@@ -13,7 +17,7 @@ export function createBacklogClientRegistry(input = {}) {
13
17
  throw new Error('Configure either BACKLOG_ORG_<NAME>_DOMAIN and BACKLOG_ORG_<NAME>_API_KEY with BACKLOG_DEFAULT_ORG, or both BACKLOG_DOMAIN and BACKLOG_API_KEY.');
14
18
  }
15
19
  const defaultName = 'default';
16
- const client = new Backlog({ host: domain, apiKey });
20
+ const client = new Backlog({ host: domain, apiKey, userAgent: USER_AGENT });
17
21
  const info = {
18
22
  name: defaultName,
19
23
  domain,
@@ -87,6 +91,7 @@ function createMultiOrganizationRegistryFromEnv(env) {
87
91
  clients.set(name, new Backlog({
88
92
  host: config.domain,
89
93
  apiKey: config.apiKey,
94
+ userAgent: USER_AGENT,
90
95
  }));
91
96
  return {
92
97
  name,
@@ -131,7 +136,11 @@ export function createOAuthBacklogClientRegistry(domain) {
131
136
  if (!token) {
132
137
  throw new Error('No OAuth access token in current request context');
133
138
  }
134
- return new Backlog({ host: domain, accessToken: token });
139
+ return new Backlog({
140
+ host: domain,
141
+ accessToken: token,
142
+ userAgent: USER_AGENT,
143
+ });
135
144
  };
136
145
  return {
137
146
  resolveClient: () => resolveOAuthClient(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backlog-mcp-server",
3
- "version": "0.13.0",
3
+ "version": "0.13.2",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "backlog-mcp-server": "./build/index.js"
@@ -26,7 +26,7 @@
26
26
  "dependencies": {
27
27
  "@hono/node-server": "^2.0.4",
28
28
  "@modelcontextprotocol/sdk": "^1.29.0",
29
- "backlog-js": "^0.16.0",
29
+ "backlog-js": "^0.18.1",
30
30
  "cosmiconfig": "^9.0.1",
31
31
  "env-var": "^7.5.0",
32
32
  "graphql": "^16.14.1",
@@ -38,7 +38,6 @@
38
38
  },
39
39
  "devDependencies": {
40
40
  "@eslint/js": "^10.0.1",
41
- "@release-it/conventional-changelog": "^11.0.1",
42
41
  "@types/node": "^25.9.2",
43
42
  "@types/yargs": "^17.0.35",
44
43
  "@typescript-eslint/eslint-plugin": "^8.60.1",
@@ -49,7 +48,6 @@
49
48
  "eslint-config-prettier": "^10.1.8",
50
49
  "eslint-plugin-prettier": "^5.5.6",
51
50
  "prettier": "^3.8.3",
52
- "release-it": "^20.2.0",
53
51
  "tsx": "^4.22.4",
54
52
  "typescript": "^6.0.3",
55
53
  "vitest": "^4.1.8"