teletype-mcp-server 0.1.0 → 0.1.1

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.
Files changed (64) hide show
  1. package/.env.example +7 -0
  2. package/LAUNCHGUIDE.md +51 -0
  3. package/README-ru.md +49 -11
  4. package/README.md +68 -30
  5. package/dist/config.d.ts +4 -0
  6. package/dist/config.js +17 -0
  7. package/dist/config.js.map +1 -1
  8. package/dist/http.js +69 -1
  9. package/dist/http.js.map +1 -1
  10. package/dist/landing-page.d.ts +1 -0
  11. package/dist/landing-page.js +166 -0
  12. package/dist/landing-page.js.map +1 -0
  13. package/dist/oauth-page.d.ts +1 -0
  14. package/dist/oauth-page.js +242 -0
  15. package/dist/oauth-page.js.map +1 -0
  16. package/dist/oauth-store.d.ts +48 -0
  17. package/dist/oauth-store.js +131 -0
  18. package/dist/oauth-store.js.map +1 -0
  19. package/dist/oauth.d.ts +4 -0
  20. package/dist/oauth.js +382 -0
  21. package/dist/oauth.js.map +1 -0
  22. package/dist/request-context.d.ts +2 -0
  23. package/dist/request-context.js.map +1 -1
  24. package/dist/tool-policy.js +7 -0
  25. package/dist/tool-policy.js.map +1 -1
  26. package/docs/CLIENTS.md +651 -27
  27. package/docs/CONTRIBUTING.md +4 -2
  28. package/docs/OAUTH.md +54 -0
  29. package/docs/SECURITY.md +3 -1
  30. package/docs/ru/CLIENTS.md +651 -27
  31. package/docs/ru/CONTRIBUTING.md +4 -2
  32. package/docs/ru/OAUTH.md +54 -0
  33. package/docs/ru/SECURITY.md +3 -1
  34. package/examples/clients/goose-stdio.yaml +13 -0
  35. package/examples/clients/openclaw.json +13 -0
  36. package/gemini-extension.json +22 -0
  37. package/lhm.plugin.json +1408 -0
  38. package/llms-install.md +17 -0
  39. package/package.json +9 -4
  40. package/plugin/.claude-plugin/plugin.json +37 -0
  41. package/plugin/.cursor-plugin/plugin.json +34 -0
  42. package/plugin/LICENSE +21 -0
  43. package/plugin/README.md +48 -0
  44. package/plugin/assets/README.md +12 -0
  45. package/plugin/assets/consent.js +32 -0
  46. package/plugin/assets/fonts/OFL.txt +93 -0
  47. package/plugin/assets/fonts/manrope.woff2 +0 -0
  48. package/plugin/assets/icon-400.png +0 -0
  49. package/plugin/assets/icon.png +0 -0
  50. package/plugin/assets/icon.svg +15 -0
  51. package/plugin/assets/landing.css +442 -0
  52. package/plugin/assets/landing.js +85 -0
  53. package/plugin/assets/logo.svg +16 -0
  54. package/plugin/commands/client-summary.md +14 -0
  55. package/plugin/commands/draft-reply.md +13 -0
  56. package/plugin/commands/escalate-issue.md +15 -0
  57. package/plugin/commands/shift-handover.md +10 -0
  58. package/plugin/commands/triage-inbox.md +13 -0
  59. package/plugin/mcp.json +10 -0
  60. package/plugin/plugin.json +15 -0
  61. package/plugin/skills/teletype-support/SKILL.md +3 -1
  62. package/plugin/skills/teletype-support/references/installation.md +31 -0
  63. package/server.json +18 -4
  64. package/smithery.yaml +3 -2
@@ -23,6 +23,8 @@ Before the first public tag:
23
23
  1. Make `https://github.com/Teletype-App/teletype-mcp-server` publicly accessible and confirm that the repository URL in `package.json` and `server.json` is correct.
24
24
  2. Deploy `https://mcp.teletype.app/mcp` with HTTPS. Run `TELETYPE_API_TOKEN=... npm run hosted:smoke` with a project token to verify the MCP handshake and a read through the Teletype Public API. The command prints no project data or token.
25
25
  3. Confirm that the npm name `teletype-mcp-server` is available and configure its Trusted Publisher. Keep the `mcpName` in `package.json` equal to the name in `server.json`.
26
- 4. Update both package and registry versions together. Run `npm run check`, `npm run package:smoke`, `npm run mcp:conformance`, `npm run bundle:mcpb`, and `GITHUB_REF_NAME=v<version> npm run release:verify`. Validate `server.json` with the official `mcp-publisher validate` command.
26
+ 4. Update both package and registry versions together. Run `npm run check`, `npm run package:smoke`, `npm run mcp:conformance`, `npm run bundle:mcpb`, and `GITHUB_REF_NAME=v<version> npm run release:verify`. Validate `server.json` against the official schema referenced by its `$schema` field.
27
27
 
28
- After the release workflow publishes npm, Docker, and the `.mcpb` asset, check their public URLs. Then authenticate with the [MCP Registry publisher](https://github.com/modelcontextprotocol/registry/blob/main/docs/modelcontextprotocol-io/quickstart.mdx) and run `mcp-publisher publish server.json`. The registry requires the npm version and remote URL in the manifest to be live. Registry publication is a separate, deliberate step.
28
+ After npm publication, the release workflow calls `publish-registry.yml`. It verifies the tag, waits for the npm version, and publishes `server.json` using [GitHub OIDC](https://github.com/modelcontextprotocol/registry/blob/main/docs/modelcontextprotocol-io/github-actions.mdx). No separate Registry secret is required. If publication fails, rerun **Publish MCP Registry** manually with the existing release tag. Check the npm, Registry, Docker, and `.mcpb` URLs after release. The remote endpoint must already be live.
29
+
30
+ Update the LobeHub manifest, Gemini extension, three plugin manifest versions, Claude and Cursor marketplaces, MCPB manifest, and pinned npm launchers together with the package version. `release:verify` checks their consistency. Regenerate LobeHub capability arrays when tool, resource, or prompt definitions change.
package/docs/OAUTH.md ADDED
@@ -0,0 +1,54 @@
1
+ English | [Русский](ru/OAUTH.md)
2
+
3
+ # OAuth for self-hosted HTTP servers
4
+
5
+ The public hosted endpoint at `https://mcp.teletype.app/mcp` has OAuth disabled and requires the project token in `X-Teletype-Api-Token`. This guide covers enabling OAuth on your own server.
6
+
7
+ OAuth is optional and disabled by default. It adds a browser connection flow over existing Teletype Public API project tokens. It does not require an OAuth provider in Teletype. A user opens the connection page from their MCP client, enters their project token, and approves access. The server verifies that token through Teletype before issuing separate OAuth credentials to the client.
8
+
9
+ The connection page supports English and Russian. It uses the browser's language until the user selects a language, then remembers that choice in a cookie. Switching languages preserves the entered token and permissions. The “Where to get a token” link opens [Teletype Public API settings](https://panel.teletype.app/settings/public-api) in a new tab.
10
+
11
+ ## Enable OAuth
12
+
13
+ Use Node.js 22.13+ or 24.x. Node.js 20 continues to support stdio and HTTP with project-token headers, but cannot run this SQLite-backed OAuth provider.
14
+
15
+ Set these variables in the server's private environment:
16
+
17
+ ```dotenv
18
+ OAUTH_ENABLED=true
19
+ PUBLIC_BASE_URL=https://your-mcp-domain.example
20
+ OAUTH_DB_PATH=/var/lib/teletype-mcp/oauth.sqlite
21
+ OAUTH_ENCRYPTION_KEY=<64-character hex key>
22
+ ```
23
+
24
+ Generate the key once with `openssl rand -hex 32` and keep it in your secret storage. Reuse it after restarts. `PUBLIC_BASE_URL` must be the public HTTPS origin. HTTP is allowed only on loopback for local development. Route `/mcp`, `/authorize`, `/oauth/consent`, `/oauth/assets/*`, `/token`, `/register`, `/revoke`, and `/.well-known/*` through the reverse proxy.
25
+
26
+ The database directory must be writable by the server user and persist between deployments. The Docker image prepares `/data` for its `node` user. Mount a named volume at `/data` and set `OAUTH_DB_PATH=/data/oauth.sqlite`. For a bind mount, give the host directory to that same user. The SQLite file belongs on a local disk. This setup suits a single host. Replicas on different machines require a shared database implementation.
27
+
28
+ The existing `X-Teletype-Api-Token` connection remains available. OAuth clients use `Authorization: Bearer <OAuth access token>`. A Teletype project token is never a valid OAuth bearer token. Do not send both authentication methods in one request.
29
+
30
+ ## Permissions and lifetime
31
+
32
+ Clients discover the protected resource at `/.well-known/oauth-protected-resource/mcp` and the authorization server at `/.well-known/oauth-authorization-server`. Registration, authorization code exchange with PKCE S256, refresh, and revocation use the OAuth endpoints above.
33
+
34
+ | Scope | Access |
35
+ | --- | --- |
36
+ | `read` | Read project data. Required for every connection |
37
+ | `write` | Write tools and marking conversations as seen. Granted only when the user checks the permission box |
38
+ | `offline_access` | Renew access automatically until the connection is revoked |
39
+
40
+ Access tokens last up to one hour. With `offline_access`, the client can obtain new access tokens without asking the user to reconnect. The approved connection has no fixed expiration date. Without `offline_access`, the connection expires after one hour. Refresh tokens rotate on every use. Reusing an old refresh token revokes that entire connection. Refresh can reduce permissions, but cannot add them.
41
+
42
+ Client registrations supporting renewable connections remain valid. Client secrets have no separate expiration date. Registrations without renewable connections expire after 30 days. Revoking one connection does not interrupt the client's other connections.
43
+
44
+ Server-wide read-only mode and toolset restrictions remain effective for OAuth connections. The existing `confirm: true` requirement on write tools still applies. OAuth permissions do not replace user approval for a specific action.
45
+
46
+ ## Storage and recovery
47
+
48
+ SQLite stores client registrations, pending consent, one-time codes, connections, and token digests. Record payloads, including project tokens, are encrypted with AES-256-GCM. Access tokens, codes, and browser secrets use SHA-256 digests. Each connection stores only its current refresh-token digest. A server-generated HMAC authenticates the connection identifier in each refresh token, so replay detection does not require storing the entire token history. The client receives OAuth credentials, never the original Teletype project token.
49
+
50
+ Code consumption, refresh rotation, and revocation run in short SQLite transactions. Expired records are rejected on reads and removed during database writes. The database file is created with owner-only permissions. SQLite files are excluded from Git and Docker build context.
51
+
52
+ Back up the database while the server is stopped, and back up the encryption key separately. Restore both with the same public origin. A wrong key or different origin prevents startup. Changing the key is not a rotation mechanism. Deleting the database invalidates all OAuth connections and requires users to reconnect. To revoke one connection, use the client's OAuth disconnect action that calls `/revoke`. Revoking the project token in Teletype also prevents further Public API operations for every connection using it.
53
+
54
+ A revoked connection is removed immediately. Expired connections are removed during the next database write. Request bodies and credentials are not logged by the OAuth handlers. Configure reverse-proxy logs to avoid recording form bodies and authorization headers.
package/docs/SECURITY.md CHANGED
@@ -4,6 +4,8 @@ English | [Русский](ru/SECURITY.md)
4
4
 
5
5
  Report vulnerabilities privately to [Teletype's Public API contact](https://teletype.app/help/api/) at [p@teletype.app](mailto:p@teletype.app). Do not publish them in an issue. Include affected versions, reproduction steps, and the possible impact.
6
6
 
7
- The HTTP transport requires `X-Teletype-Api-Token` on every MCP request and passes it to Teletype. There are no separate MCP users or scopes. Use HTTPS for remote access and treat the token as full project access. The server checks that a token was supplied, then Teletype checks whether it is valid when an API operation runs.
7
+ By default, HTTP requires `X-Teletype-Api-Token` on every MCP request and passes it to Teletype. Use HTTPS for remote access and treat the project token as full project access. Teletype checks its validity when an API operation runs.
8
+
9
+ OAuth is disabled on the public hosted endpoint. If you explicitly enable [OAuth](OAUTH.md) on your own server, it verifies the project token during consent, stores it encrypted in SQLite, and gives the client separate bearer credentials with read/write permissions. OAuth credentials are restricted to this server's `/mcp` resource. Read-only OAuth access disables writes even if the deployment enables them. Server restrictions and explicit write confirmation still apply. Refresh-token reuse revokes the connection. Keep the database and its encryption key private and back them up separately.
8
10
 
9
11
  Local file uploads through `attachment_path` are available only in stdio mode.