togello-mcp-server 1.0.45 → 1.0.48

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 CHANGED
@@ -65,8 +65,40 @@ Remote OAuth clients that connect to `/mcp` should discover protected resource m
65
65
 
66
66
  The configured OAuth issuer must be an origin URL without a path component.
67
67
 
68
+ Clients that use `list-active-scheduling-polls` must explicitly include `gathers:read` in the OAuth authorization request alongside the scopes they already need. For an existing connection without `gathers:read`, start a new authorization from the client's reconnect or reauthorize flow and approve the scope on the Togello consent screen. Existing grants keep their original scopes on refresh. Continue requesting `offline_access` when the client needs a refresh token. For stdio or `env` mode, provide the resulting OAuth access token as `TOGELLO_API_TOKEN` to use this tool.
69
+
68
70
  For OpenAI Apps domain verification, set `TOGELLO_MCP_OPENAI_APPS_CHALLENGE_TOKEN` to the verification token. Remote mode then serves it from `/.well-known/openai-apps-challenge` as `text/plain`. If both `TOGELLO_MCP_OPENAI_APPS_CHALLENGE_TOKEN` and `OPENAI_APPS_CHALLENGE_TOKEN` are set, the Togello-scoped variable takes precedence.
69
71
 
72
+ ### Muse host verification (provisional)
73
+
74
+ Remote mode supports an independent opt-in `TOGELLO_MCP_MUSE_CHALLENGE_TOKEN`.
75
+ Unset or empty disables the route. A configured token must contain 1–256 ASCII
76
+ letters, digits, underscores or hyphens; whitespace, dots, slashes, percent escapes
77
+ and other characters are rejected at startup without logging the value. Values
78
+ are never trimmed or decoded. There is no fallback to the OpenAI Apps token.
79
+
80
+ With the explicit dummy token `dummy-muse-token`, only
81
+ `GET /.well-known/muse-challenge/dummy-muse-token` returns HTTP 200,
82
+ `Content-Type: text/plain; charset=utf-8`, `Cache-Control: no-store` and exactly
83
+ `muse-challenge=dummy-muse-token` (no newline). It requires no authentication and
84
+ performs no redirect or upstream/file lookup. Other tokens, query strings,
85
+ encoded or normalized path variants, and other methods receive 404. Existing
86
+ OpenAI Apps verification, OAuth metadata and MCP authentication remain independent.
87
+
88
+ The [official connector guidelines](https://platform.muse.ai/docs) describe the
89
+ submission process. The exact challenge path and body above follow an
90
+ [applicant's first-hand report](https://reviewtimes.fyi/muse#how-review-works),
91
+ not a confirmed official wire specification. Before enabling this setting,
92
+ compare the actual submission UI's issued URL, token and required body with this
93
+ provisional contract. If the format differs or the token fails validation, leave
94
+ it disabled and update the implementation; do not weaken validation or guess a
95
+ value. No real challenge has been issued or verified by this implementation.
96
+
97
+ The MCP handler does not log challenge values or request paths. Reverse proxies,
98
+ CDNs and hosting access logs are outside this handler's control; ensure their
99
+ logging policy also protects the token before enabling verification. Remove the
100
+ setting after verification or expiration and restart the server.
101
+
70
102
  ## Tools
71
103
 
72
104
  All tools set MCP `readOnlyHint`, `openWorldHint`, and `destructiveHint` annotations explicitly. Read-only tools return stable JSON in both `structuredContent` and text content.
@@ -77,9 +109,11 @@ All tools set MCP `readOnlyHint`, `openWorldHint`, and `destructiveHint` annotat
77
109
  - `get-today-calendar`: Retrieves linked Google Calendar events and scheduled tasks.
78
110
  - `get-activity-item-list`: Retrieves enabled activity items.
79
111
  - `get-activity-log-list`: Retrieves activity logs.
80
- - `get-active-gathers`: Retrieves active scheduling polls created or previously viewed by the authenticated user, using `GET /v2/gathers`. Takes no arguments. Unconfirmed polls are active through their adjustment end time; confirmed events and recruitments are active through their start time, inclusive. Already-started events are excluded even if they have not ended. Missing or invalid eligibility dates are excluded. Results retain API ordering and contain only UUID, title, mode, adjustment and confirmed timestamps, participant counts, and relationship type. Returns `{ "gathers": [] }` when none qualify; API failures are errors.
112
+ - `list-active-scheduling-polls`: Lists active scheduling polls (ADJUSTMENT), confirmed events (CONFIRM), and recruitments (RECRUITMENT) created or previously viewed by the authenticated user, using `GET /v2/integration/gathers` with a Togello OAuth access token granted `gathers:read`. Takes no arguments. Unconfirmed polls are active through their adjustment end time; confirmed events and recruitments are active through their start time, inclusive. Already-started events are excluded even if they have not ended. Missing or invalid eligibility dates are excluded. Results retain API ordering and contain only UUID, title, mode, adjustment and confirmed timestamps, participant counts, and relationship type. Returns `{ "gathers": [] }` when none qualify; API failures are errors.
81
113
  - `get-japan-current-time`: Returns the current time in Japan.
82
114
 
115
+ The former tool ID `get-active-gathers` has been replaced by `list-active-scheduling-polls`; clients that store the old ID must update it. No compatibility alias is provided.
116
+
83
117
  Write tools return JSON. Failed tool responses also return JSON and are marked with `isError: true`. Tools that can overwrite existing private Togello data set `destructiveHint: true`; create/start tools set `destructiveHint: false`.
84
118
 
85
119
  - `create-task`: Creates a TODO task.
@@ -91,11 +125,21 @@ Write tools return JSON. Failed tool responses also return JSON and are marked w
91
125
 
92
126
  ## Development
93
127
 
128
+ With [mise](https://mise.jdx.dev/) installed, trust this repository's configuration once:
129
+
130
+ ```bash
131
+ mise trust
132
+ ```
133
+
134
+ Then build or run the tests:
135
+
94
136
  ```bash
95
- npm ci
96
- npm test
137
+ mise run build
138
+ mise run test
97
139
  ```
98
140
 
141
+ These tasks install the Node.js version pinned in `mise.toml` and run `npm ci --include=dev` before building. TypeScript's `tsc` comes from the project's development dependencies; no global TypeScript installation is needed, including when `NODE_ENV=production` is set.
142
+
99
143
  The protocol tests exercise SDK v2 modern clients and SDK v1.32.2 legacy clients over stdio, Streamable HTTP, and legacy SSE against a local mock API. They verify the 12 existing tool contracts and the added deletion and active scheduling poll tools, read/write/delete results, request credential isolation, protocol header errors, body limits, metadata, and legacy session lifecycle. `test/fixtures/v1-tools.json` records `tools/list` from server 1.0.42 at commit `558c2c2fda81f7c8b20f443afa1bf5e554a72dad`; comparisons allow the SDK's JSON Schema dialect and wire-format changes.
100
144
 
101
145
  SDK-facing schemas use Zod 4. UUID fields retain the prior permissive UUID syntax, and date-time fields retain their previous Zod 3 validation through the compatibility export included in the Zod package.
@@ -107,8 +151,18 @@ https://mcpreview.com/mcp-servers/toru-takagi/togello-mcp-server
107
151
 
108
152
  ## Publish
109
153
 
154
+ After running `mise trust` once, run this command from an interactive terminal to increment the version in the local `package.json` and publish it:
155
+
156
+ ```bash
157
+ mise run patch
158
+ ```
159
+
160
+ You can also specify an exact unpublished version:
161
+
110
162
  ```bash
111
- npm run build
112
- npm version patch
113
- npm publish --access public
163
+ mise run release 1.0.46
114
164
  ```
165
+
166
+ The release task installs the dependencies, builds the server, and runs the tests. It then checks the current npm login with `npm whoami`. If that check fails, it runs `npm login` and checks again. Complete the browser sign-in with an npm account that can publish this package. Once npm confirms the login, the task updates `package.json` and `package-lock.json` and publishes with `--access public`. npm may request two-factor authentication during publishing.
167
+
168
+ The task does not create a Git commit or tag. Version changes and generated `build/` files remain in the working tree for review and commit. If publishing fails after the version changes, fix the failure and retry with `mise run release <version>`, using the exact version now in `package.json`. Running `mise run patch` again increments it again. If that version is already published, choose a new version.
package/build/client.js CHANGED
@@ -1,5 +1,12 @@
1
1
  import { getUpstreamToken } from './upstreamTokenContext.js';
2
2
  const API_BASE_URL = process.env.TOGELLO_API_BASE_URL ?? 'https://togello.api.toru-takagi.dev';
3
+ export class HttpStatusError extends Error {
4
+ status;
5
+ constructor(status) {
6
+ super(`response status: ${status}`);
7
+ this.status = status;
8
+ }
9
+ }
3
10
  function getApiTokenOrThrow() {
4
11
  const token = getUpstreamToken() ?? process.env.TOGELLO_API_TOKEN;
5
12
  if (!token) {
@@ -32,7 +39,7 @@ export const httpClient = {
32
39
  },
33
40
  });
34
41
  if (!response.ok) {
35
- throw new Error(`response status: ${response.status}`);
42
+ throw new HttpStatusError(response.status);
36
43
  }
37
44
  return (await response.json());
38
45
  },
@@ -1,10 +1,10 @@
1
- import { httpClient } from '../../client.js';
1
+ import { HttpStatusError, httpClient } from '../../client.js';
2
2
  import { errorToolResponse, jsonToolResponse } from './toolResponse.js';
3
3
  export const getActiveGathersHandler = async () => {
4
4
  const now = Date.now();
5
5
  try {
6
6
  const gathers = await httpClient.fetchURL({
7
- path: '/v2/gathers',
7
+ path: '/v2/integration/gathers',
8
8
  });
9
9
  return jsonToolResponse({
10
10
  gathers: gathers
@@ -28,7 +28,15 @@ export const getActiveGathersHandler = async () => {
28
28
  })),
29
29
  });
30
30
  }
31
- catch {
31
+ catch (error) {
32
+ if (error instanceof HttpStatusError) {
33
+ if (error.status === 401) {
34
+ return errorToolResponse('A valid Togello OAuth access token with gathers:read is required. Reconnect or reauthorize with Togello OAuth.');
35
+ }
36
+ if (error.status === 403) {
37
+ return errorToolResponse('The gathers:read scope is required. Reauthorize the Togello OAuth connection and grant gathers:read.');
38
+ }
39
+ }
32
40
  return errorToolResponse('Error retrieving active gathers');
33
41
  }
34
42
  };
package/build/index.js CHANGED
@@ -41,6 +41,7 @@ async function main() {
41
41
  oauthIssuer,
42
42
  sseKeepAliveMs: keepAliveMs,
43
43
  openaiAppsChallengeToken,
44
+ museChallengeToken: process.env.TOGELLO_MCP_MUSE_CHALLENGE_TOKEN,
44
45
  });
45
46
  return;
46
47
  }
@@ -241,8 +241,8 @@ export function createMcpServer(options = {}) {
241
241
  inputSchema: z.object({}),
242
242
  annotations: readOnlyToolAnnotations,
243
243
  }, withUpstreamToken(getJapanCurrentTimeHandler, options.resolveUpstreamToken, options.requireUpstreamToken));
244
- server.registerTool('get-active-gathers', {
245
- description: 'Retrieves active scheduling polls created or previously viewed by the authenticated user. Unconfirmed polls remain active until the adjustment end time; confirmed events and recruitments remain active until their start time, inclusive. Events that have already started are excluded.',
244
+ server.registerTool('list-active-scheduling-polls', {
245
+ description: 'Lists active scheduling polls (ADJUSTMENT), confirmed events (CONFIRM), and recruitments (RECRUITMENT) created or previously viewed by the authenticated user. Unconfirmed polls remain active until the adjustment end time; confirmed events and recruitments remain active until their start time, inclusive. Events that have already started are excluded. Requires the gathers:read OAuth scope.',
246
246
  inputSchema: z.strictObject({}),
247
247
  annotations: readOnlyToolAnnotations,
248
248
  }, withUpstreamToken(getActiveGathersHandler, options.resolveUpstreamToken, options.requireUpstreamToken));
@@ -13,6 +13,7 @@ const authorizationServerMetadataCorsHeaders = {
13
13
  };
14
14
  const protectedResourceMetadataPath = '/.well-known/oauth-protected-resource';
15
15
  const openaiAppsChallengePath = '/.well-known/openai-apps-challenge';
16
+ const museChallengePrefix = '/.well-known/muse-challenge/';
16
17
  const maxRequestBodyBytes = 1_000_000;
17
18
  const supportedScopes = [
18
19
  'offline_access',
@@ -21,8 +22,18 @@ const supportedScopes = [
21
22
  'activity:read',
22
23
  'activity:write',
23
24
  'calendar:read',
25
+ 'gathers:read',
24
26
  ];
25
27
  export async function startRemoteServer(options) {
28
+ const museChallengeToken = options.museChallengeToken;
29
+ if (museChallengeToken !== undefined &&
30
+ museChallengeToken !== '' &&
31
+ !/^[A-Za-z0-9_-]{1,256}$/.test(museChallengeToken)) {
32
+ throw new Error('Invalid TOGELLO_MCP_MUSE_CHALLENGE_TOKEN');
33
+ }
34
+ const museChallengePath = museChallengeToken
35
+ ? `${museChallengePrefix}${museChallengeToken}`
36
+ : undefined;
26
37
  const mcpPath = options.mcpPath ?? '/mcp';
27
38
  const ssePath = options.ssePath ?? '/sse';
28
39
  const messagePath = options.messagePath ?? '/message';
@@ -77,6 +88,15 @@ export async function startRemoteServer(options) {
77
88
  });
78
89
  const server = createServer(async (req, res) => {
79
90
  try {
91
+ if (req.url?.startsWith(museChallengePrefix)) {
92
+ if (req.method === 'GET' && req.url === museChallengePath) {
93
+ writeTextResponse(res, `muse-challenge=${museChallengeToken}`);
94
+ }
95
+ else {
96
+ res.writeHead(404).end('Not found');
97
+ }
98
+ return;
99
+ }
80
100
  const requestUrl = new URL(req.url ?? '/', `http://${req.headers.host ?? 'localhost'}`);
81
101
  if (requestUrl.pathname === openaiAppsChallengePath) {
82
102
  if (req.method === 'OPTIONS') {
@@ -220,8 +240,8 @@ export async function startRemoteServer(options) {
220
240
  }
221
241
  res.writeHead(404).end('Not found');
222
242
  }
223
- catch (error) {
224
- console.error('Remote server error:', error);
243
+ catch {
244
+ console.error('Remote server error');
225
245
  if (!res.headersSent) {
226
246
  res.writeHead(500);
227
247
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "togello-mcp-server",
4
- "version": "1.0.45",
4
+ "version": "1.0.48",
5
5
  "description": "MCP server for Togello tasks, calendar memos, calendar events, and activity logs.",
6
6
  "main": "build/index.js",
7
7
  "scripts": {