diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 763462fa..43fd5a73 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -9,9 +9,7 @@ "postCreateCommand": "yarn install", "customizations": { "vscode": { - "extensions": [ - "esbenp.prettier-vscode" - ] + "extensions": ["esbenp.prettier-vscode"] } } } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5aba00bb..6375e9ce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,6 +68,15 @@ jobs: AUTH: ${{ steps.github-oidc.outputs.github_token }} SHA: ${{ github.sha }} run: ./scripts/utils/upload-artifact.sh + + - name: Upload MCP Server tarball + if: github.repository == 'stainless-sdks/julep-node' + env: + URL: https://pkg.stainless.com/s?subpackage=mcp-server + AUTH: ${{ steps.github-oidc.outputs.github_token }} + SHA: ${{ github.sha }} + BASE_PATH: packages/mcp-server + run: ./scripts/utils/upload-artifact.sh test: timeout-minutes: 10 name: test diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 996b6017..9114f18e 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -16,6 +16,8 @@ jobs: publish: name: publish runs-on: ubuntu-latest + permissions: + contents: write steps: - uses: actions/checkout@v4 @@ -39,3 +41,10 @@ jobs: yarn tsn scripts/publish-packages.ts "{ \"paths_released\": \"$PATHS_RELEASED\" }" env: NPM_TOKEN: ${{ secrets.JULEP_NPM_TOKEN || secrets.NPM_TOKEN }} + + - name: Upload MCP Server DXT GitHub release asset + run: | + gh release upload ${{ github.event.release.tag_name }} \ + packages/mcp-server/julep_sdk_api.mcpb + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index d98d51a8..d62bea50 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,6 @@ dist dist-deno /*.tgz .idea/ - +.eslintcache +dist-bundle +*.mcpb diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 880c4403..7a564723 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.7.4" + ".": "2.8.0" } diff --git a/.stats.yml b/.stats.yml index e4dce284..5dd9fb94 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 66 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/julep-ai-inc-dash%2Fjulep-21c8182519ef811d16673113f293a4b667ccd0176bdf867e8a1701b520d0bce7.yml -openapi_spec_hash: 3a08e0e8f22356dd768b19bd7e0950eb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/julep-ai-inc-dash%2Fjulep-3b1bb98879ed268512c20dfd8ab30d237362e6dc25cbf384e59173ce9ac18d03.yml +openapi_spec_hash: a3f61930f630788c17daa9ec5be09d0f config_hash: 5cb77b8389154096b85883a93680f511 diff --git a/CHANGELOG.md b/CHANGELOG.md index fa4339f5..0297dfa1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,116 @@ # Changelog +## 2.8.0 (2025-12-11) + +Full Changelog: [v2.7.4...v2.8.0](https://github.com/julep-ai/node-sdk/compare/v2.7.4...v2.8.0) + +### Features + +* **api:** api update ([0602cc7](https://github.com/julep-ai/node-sdk/commit/0602cc745f55c0871505ed2e62983c5375474fb3)) +* **api:** api update ([f5f76e7](https://github.com/julep-ai/node-sdk/commit/f5f76e7de501387cb282816bfaf0e77a728bb7dd)) +* **api:** api update ([f9d4d09](https://github.com/julep-ai/node-sdk/commit/f9d4d09a84f8e7e0effee08a80ae72f73962d6fe)) +* **api:** api update ([53404bd](https://github.com/julep-ai/node-sdk/commit/53404bd2c0d6902eb8f47c408aa03bfeaebf8ce5)) +* **mcp:** add client infer to cloudflare oauth screen ([3ea626e](https://github.com/julep-ai/node-sdk/commit/3ea626ec8f75069484d2a0a4fd133c7993c94dbe)) +* **mcp:** add code execution tool ([1e00ca0](https://github.com/julep-ai/node-sdk/commit/1e00ca0f773fc45220972ee123ad198f06f95604)) +* **mcp:** add detail field to docs search tool ([122e298](https://github.com/julep-ai/node-sdk/commit/122e29863c49d7d88158a672a944e9a0fc591557)) +* **mcp:** add docs search tool ([269087f](https://github.com/julep-ai/node-sdk/commit/269087f17b239c24f60c7bf0c771e264bdb6756c)) +* **mcp:** add logging when environment variable is set ([be36e15](https://github.com/julep-ai/node-sdk/commit/be36e1520c295adc4396ff8f85b46203e3a3b8f4)) +* **mcp:** add mcp bundles to build script ([1bb1db5](https://github.com/julep-ai/node-sdk/commit/1bb1db5552b897d8122013a3a701203796a1964c)) +* **mcp:** add option for including docs tools ([7ec226e](https://github.com/julep-ai/node-sdk/commit/7ec226e7ff1f5ad69e8e2dfed7c3916391e0db88)) +* **mcp:** add option to infer mcp client ([2d55b8d](https://github.com/julep-ai/node-sdk/commit/2d55b8db6791b4780ab33d6bc3beb3e168f4640d)) +* **mcp:** add typescript check to code execution tool ([01c6570](https://github.com/julep-ai/node-sdk/commit/01c6570a42b7627073d227b58f22290d75a69e2c)) +* **mcp:** add unix socket option for remote MCP ([e2fdc8b](https://github.com/julep-ai/node-sdk/commit/e2fdc8be5b7f55135fe889bb68ff076ff2e83c9f)) +* **mcp:** allow setting logging level ([92e01a7](https://github.com/julep-ai/node-sdk/commit/92e01a7daca8f851400d1bce1d1a04f4c9636a2b)) +* **mcp:** change remote server query option parsing logic ([1ce88f0](https://github.com/julep-ai/node-sdk/commit/1ce88f05b38e6e58c248f4a0891142026bcfe98a)) +* **mcp:** enable experimental docs search tool ([c09861a](https://github.com/julep-ai/node-sdk/commit/c09861a599eb52fb7d38a67d5eec9552f55226f4)) +* **mcp:** enable optional code execution tool on http mcp servers ([5aa88d4](https://github.com/julep-ai/node-sdk/commit/5aa88d4899c9a29e93de6facf2d5f97c837679f7)) +* **mcp:** expose client options in `streamableHTTPApp` ([c79c312](https://github.com/julep-ai/node-sdk/commit/c79c3127c770a96d946ed25d9a413d701cd807ff)) +* **mcp:** handle code mode calls in the Stainless API ([e4ad4ae](https://github.com/julep-ai/node-sdk/commit/e4ad4ae8f90c4332df65f8d5d0b357db47ab6d4a)) +* **mcp:** parse query string as mcp client options in mcp server ([ca31e54](https://github.com/julep-ai/node-sdk/commit/ca31e54b1bb7be289a73cad5ed1fd445a9b9f99c)) +* **mcp:** remote server with passthru auth ([e98a089](https://github.com/julep-ai/node-sdk/commit/e98a0891b4800926d6d8ac8b796f93fd193f27ec)) +* **mcp:** return logs on code tool errors ([67c1ed9](https://github.com/julep-ai/node-sdk/commit/67c1ed96991234dff93cc1cea655cafb0c2622c7)) + + +### Bug Fixes + +* **ci:** set permissions for DXT publish action ([ce6f62c](https://github.com/julep-ai/node-sdk/commit/ce6f62cd2ee3b6c9164e3439f5ce10eaaaedd822)) +* **client:** incorrect offset pagination check ([87e78b8](https://github.com/julep-ai/node-sdk/commit/87e78b8b6e5fc759686bdc2c390838d6faf27844)) +* coerce nullable values to undefined ([3d6056f](https://github.com/julep-ai/node-sdk/commit/3d6056f40235d4360435af2e8511bb5993cbb8e4)) +* **mcp:** add client instantiation options to code tool ([adb99b7](https://github.com/julep-ai/node-sdk/commit/adb99b75fbc01aa5ce7703f521fbc5066b474c4a)) +* **mcpb:** pin @anthropic-ai/mcpb version ([e2809b3](https://github.com/julep-ai/node-sdk/commit/e2809b3a047cbdf1a54b6394198bf727a3bd304a)) +* **mcp:** correct code tool API endpoint ([b19afe0](https://github.com/julep-ai/node-sdk/commit/b19afe08dd9c1337aa2e1fb3532c717fc62233b9)) +* **mcp:** fix bug in header handling ([c0d1022](https://github.com/julep-ai/node-sdk/commit/c0d102255f5453422dc5b562a0a0c0c7049e0c69)) +* **mcp:** fix cli argument parsing logic ([e0d84e5](https://github.com/julep-ai/node-sdk/commit/e0d84e5d5b723ab7f5b2a9131d28616086453a6c)) +* **mcp:** fix query options parsing ([1fa531c](https://github.com/julep-ai/node-sdk/commit/1fa531ceb0e673aac6179dadd83a65d4f36c7642)) +* **mcp:** fix some response schemas used for jq filtering ([b0f97cf](https://github.com/julep-ai/node-sdk/commit/b0f97cfbdc8f4e4beba885684d946b3aa3532982)) +* **mcp:** fix uploading dxt release assets ([7854bfd](https://github.com/julep-ai/node-sdk/commit/7854bfdcc35420bb1825a30ab01b39e5a0023e7a)) +* **mcp:** generate additionalProperties=true for map schemas to avoid validation issues ([12bd79f](https://github.com/julep-ai/node-sdk/commit/12bd79f67acb13742b83e0bd692f58e8759cef8b)) +* **mcp:** resolve a linting issue in server code ([e866428](https://github.com/julep-ai/node-sdk/commit/e866428139e209784086a2219660fa6f6168a9e4)) +* **mcp:** return correct lines on typescript errors ([4d8eb4c](https://github.com/julep-ai/node-sdk/commit/4d8eb4ced3e338c82b3618b81f699a942f780b34)) +* **mcp:** return tool execution error on api error ([48209fc](https://github.com/julep-ai/node-sdk/commit/48209fc16212d444baa94141825deb17972d9c5f)) +* **mcp:** return tool execution error on jq failure ([c717c94](https://github.com/julep-ai/node-sdk/commit/c717c942ba11a3bedd2af7b8e4d660dcbb2419a2)) + + +### Performance Improvements + +* faster formatting ([fbb1589](https://github.com/julep-ai/node-sdk/commit/fbb1589e1287a6b7d4880a243ab1559d3bf29180)) + + +### Chores + +* ci build action ([82be9a4](https://github.com/julep-ai/node-sdk/commit/82be9a42306af22a0e70f909553ae05643389b15)) +* **codegen:** internal codegen update ([a7f4ec9](https://github.com/julep-ai/node-sdk/commit/a7f4ec91e05ebe0764064280a4e1942c56bc254f)) +* **deps:** update dependency node-fetch to v2.6.13 ([c62fad2](https://github.com/julep-ai/node-sdk/commit/c62fad2a45e62eb30e842a7a0795316c43fadb6f)) +* do not install brew dependencies in ./scripts/bootstrap by default ([ad1dec4](https://github.com/julep-ai/node-sdk/commit/ad1dec48b3925c5a522192cc519e2e8782d24b37)) +* extract some types in mcp docs ([438f807](https://github.com/julep-ai/node-sdk/commit/438f8073a887f9375e482d3ea4a744b3ba3d18c7)) +* **internal:** codegen related update ([47bcda4](https://github.com/julep-ai/node-sdk/commit/47bcda4efbce2c72a4fc36dbd7b10b97f313bc3d)) +* **internal:** codegen related update ([7fb00f0](https://github.com/julep-ai/node-sdk/commit/7fb00f02ff4e2e992e01771465f95efa3c93abdf)) +* **internal:** codegen related update ([6fd386f](https://github.com/julep-ai/node-sdk/commit/6fd386f5bf3d5fb6cc5160117dcd75225d033f58)) +* **internal:** codegen related update ([14f1d5a](https://github.com/julep-ai/node-sdk/commit/14f1d5a803b499ca8e6b488beae1f69f04627a3f)) +* **internal:** codegen related update ([afd9e2f](https://github.com/julep-ai/node-sdk/commit/afd9e2f21798037026c4aa52f3fb23e4b0d4c119)) +* **internal:** codegen related update ([cf90b27](https://github.com/julep-ai/node-sdk/commit/cf90b27161d72ab3ebef74ce779c2f8341457e35)) +* **internal:** codegen related update ([f9801ac](https://github.com/julep-ai/node-sdk/commit/f9801ac0ec4e91a5165f34a1a12bcfea73a5add2)) +* **internal:** codegen related update ([b09d85c](https://github.com/julep-ai/node-sdk/commit/b09d85c6a6e0bc2eac482ba9cfb9b7b09ec5679d)) +* **internal:** fix incremental formatting in some cases ([9db3270](https://github.com/julep-ai/node-sdk/commit/9db3270f61c87cd831c4e4640d9dca3d52e03b9f)) +* **internal:** formatting change ([12fb0e6](https://github.com/julep-ai/node-sdk/commit/12fb0e6a7dd00c23e1be0187f9980c9e3494974e)) +* **internal:** gitignore .mcpb files ([1379dad](https://github.com/julep-ai/node-sdk/commit/1379dad5516bf5c4d7377ba5b0fcac8acd2c6564)) +* **internal:** grammar fix (it's -> its) ([0683aeb](https://github.com/julep-ai/node-sdk/commit/0683aeb95c43df79890d5604597c947a3c5d7396)) +* **internal:** ignore .eslintcache ([19aa6c1](https://github.com/julep-ai/node-sdk/commit/19aa6c137cd938c55a4a1ad639ac6998a4ad0063)) +* **internal:** make mcp-server publishing public by defaut ([a80dd72](https://github.com/julep-ai/node-sdk/commit/a80dd722b30a9f2448d873dd63084daa3377ebdc)) +* **internal:** move publish config ([e9e8777](https://github.com/julep-ai/node-sdk/commit/e9e87771a244b79cf4acfb3eac691a6ece19dd45)) +* **internal:** refactor array check ([fd2fa21](https://github.com/julep-ai/node-sdk/commit/fd2fa21ceeef064b14d4db7282d0927170ec6103)) +* **internal:** remove .eslintcache ([0a2fdd6](https://github.com/julep-ai/node-sdk/commit/0a2fdd60302b10b9b5ccfc25902cecacda32444a)) +* **internal:** remove deprecated `compilerOptions.baseUrl` from tsconfig.json ([1174a7f](https://github.com/julep-ai/node-sdk/commit/1174a7f5b63bb5cbb0233ecdb79bcb5562339b96)) +* **internal:** update comment in script ([dae9b0f](https://github.com/julep-ai/node-sdk/commit/dae9b0fbfa4616d0211eaff2747723e4eca697c8)) +* **internal:** use npm pack for build uploads ([5c45d4c](https://github.com/julep-ai/node-sdk/commit/5c45d4ca134673d609811ed299cf05454a2e0cfb)) +* mcp code tool explicit error message when missing a run function ([bc1b68e](https://github.com/julep-ai/node-sdk/commit/bc1b68ef5d32565ed56f4906df6d92bd3e0e4593)) +* **mcp:** add cors to oauth metadata route ([cc312bc](https://github.com/julep-ai/node-sdk/commit/cc312bcae0e89e1d92eb515ec80fc761d5e91729)) +* **mcp:** add friendlier MCP code tool errors on incorrect method invocations ([3341c0e](https://github.com/julep-ai/node-sdk/commit/3341c0e1190583108b1e17a867a30c9b6d42e316)) +* **mcp:** add line numbers to code tool errors ([70bf6d0](https://github.com/julep-ai/node-sdk/commit/70bf6d073837b67d3f2b7dee3bc5a623822c3388)) +* **mcp:** allow pointing `docs_search` tool at other URLs ([29f1271](https://github.com/julep-ai/node-sdk/commit/29f127175999ad32c2b29a6148c00b101a5f2910)) +* **mcp:** clarify http auth error ([b8623e9](https://github.com/julep-ai/node-sdk/commit/b8623e9a8d4ab974c59be1c29ffdacdd5e1e6d8e)) +* **mcp:** document remote server in README.md ([0b818f2](https://github.com/julep-ai/node-sdk/commit/0b818f293d83c27fd26f625a69f3e17ead61bbea)) +* **mcp:** minor cleanup of types and package.json ([dc011fe](https://github.com/julep-ai/node-sdk/commit/dc011fea568e36e556942012656a4cfcc4ccd101)) +* **mcp:** refactor streamable http transport ([00cb972](https://github.com/julep-ai/node-sdk/commit/00cb972cf1a90c69d879c10d0417e0429f76b88d)) +* **mcp:** rename dxt to mcpb ([551b096](https://github.com/julep-ai/node-sdk/commit/551b0962e23197a7f840e72481bfd1957603ddff)) +* **mcp:** update lockfile ([5b0ef90](https://github.com/julep-ai/node-sdk/commit/5b0ef90b166d510f91594c4ab1782466b3d2eebd)) +* **mcp:** update package.json ([0d2ee4b](https://github.com/julep-ai/node-sdk/commit/0d2ee4b3982034605a315adfdc2aecc6a6fbc5bd)) +* **mcp:** update README ([0d69b8d](https://github.com/julep-ai/node-sdk/commit/0d69b8d3a63228328cadcaeb97f8ec06942f691e)) +* **mcp:** update types ([6b6f77c](https://github.com/julep-ai/node-sdk/commit/6b6f77c4742e866839b0edb290422f61c96e44c2)) +* **mcp:** upgrade jq-web ([62ddb5b](https://github.com/julep-ai/node-sdk/commit/62ddb5b12b87bcf76501eb3819524f1b06e48113)) +* **mcp:** upload dxt as release asset ([8565331](https://github.com/julep-ai/node-sdk/commit/856533108438a2ff00f3cbf84debf022ad4b2658)) +* update @stainless-api/prism-cli to v5.15.0 ([3237c3b](https://github.com/julep-ai/node-sdk/commit/3237c3b7e985e59c6459fbda21f3e79353187df1)) +* update CI script ([eb0d865](https://github.com/julep-ai/node-sdk/commit/eb0d8650804d09b5a0ffe4561250b1e82eaf979d)) +* update lockfile ([1fb9f41](https://github.com/julep-ai/node-sdk/commit/1fb9f4126f4c5a17a4317dcdf514100a10a94f69)) +* use latest @modelcontextprotocol/sdk ([4832ece](https://github.com/julep-ai/node-sdk/commit/4832ececf6d2f9a78b9ca32a17b03a5b232fec37)) +* use structured error when code execution tool errors ([db94eb7](https://github.com/julep-ai/node-sdk/commit/db94eb75a0897677db72191a268c49129c7c5183)) + + +### Documentation + +* **mcp:** add a README button for one-click add to Cursor ([e925a0f](https://github.com/julep-ai/node-sdk/commit/e925a0f9524b70237decae3ee8351378e5fc700a)) +* **mcp:** add a README link to add server to VS Code or Claude Code ([72a04d7](https://github.com/julep-ai/node-sdk/commit/72a04d70df45bd08ef155dec5e09f540abcd9abd)) + ## 2.7.4 (2025-08-01) Full Changelog: [v2.7.3...v2.7.4](https://github.com/julep-ai/node-sdk/compare/v2.7.3...v2.7.4) diff --git a/bin/publish-npm b/bin/publish-npm index fa2243d2..45e8aa80 100644 --- a/bin/publish-npm +++ b/bin/publish-npm @@ -58,4 +58,4 @@ else fi # Publish with the appropriate tag -yarn publish --access public --tag "$TAG" +yarn publish --tag "$TAG" diff --git a/package.json b/package.json index d5035477..6a59d562 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@julep/sdk", - "version": "2.7.4", + "version": "2.8.0", "description": "The official TypeScript library for the Julep API", "author": "Julep ", "types": "dist/index.d.ts", @@ -13,6 +13,9 @@ "**/*" ], "private": false, + "publishConfig": { + "access": "public" + }, "scripts": { "test": "./scripts/test", "build": "./scripts/build", diff --git a/packages/mcp-server/README.md b/packages/mcp-server/README.md index bc08edf8..f50af5e5 100644 --- a/packages/mcp-server/README.md +++ b/packages/mcp-server/README.md @@ -36,12 +36,36 @@ For clients with a configuration JSON, it might look something like this: } ``` +### Cursor + +If you use Cursor, you can install the MCP server by using the button below. You will need to set your environment variables +in Cursor's `mcp.json`, which can be found in Cursor Settings > Tools & MCP > New MCP Server. + +[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=@julep/sdk-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBqdWxlcC9zZGstbWNwIl0sImVudiI6eyJKVUxFUF9BUElfS0VZIjoiU2V0IHlvdXIgSlVMRVBfQVBJX0tFWSBoZXJlLiJ9fQ) + +### VS Code + +If you use MCP, you can install the MCP server by clicking the link below. You will need to set your environment variables +in VS Code's `mcp.json`, which can be found via Command Palette > MCP: Open User Configuration. + +[Open VS Code](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40julep%2Fsdk-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40julep%2Fsdk-mcp%22%5D%2C%22env%22%3A%7B%22JULEP_API_KEY%22%3A%22Set%20your%20JULEP_API_KEY%20here.%22%7D%7D) + +### Claude Code + +If you use Claude Code, you can install the MCP server by running the command below in your terminal. You will need to set your +environment variables in Claude Code's `.claude.json`, which can be found in your home directory. + +``` +claude mcp add --transport stdio julep_sdk_api --env JULEP_API_KEY="Your JULEP_API_KEY here." -- npx -y @julep/sdk-mcp +``` + ## Exposing endpoints to your MCP Client -There are two ways to expose endpoints as tools in the MCP server: +There are three ways to expose endpoints as tools in the MCP server: 1. Exposing one tool per endpoint, and filtering as necessary 2. Exposing a set of tools to dynamically discover and invoke endpoints from the API +3. Exposing a docs search tool and a code execution tool, allowing the client to write code to be executed against the TypeScript client ### Filtering endpoints and tools @@ -76,6 +100,18 @@ All of these command-line options can be repeated, combined together, and have c Use `--list` to see the list of available tools, or see below. +### Code execution + +If you specify `--tools=code` to the MCP server, it will expose just two tools: + +- `search_docs` - Searches the API documentation and returns a list of markdown results +- `execute` - Runs code against the TypeScript client + +This allows the LLM to implement more complex logic by chaining together many API calls without loading +intermediary results into its context window. + +The code execution itself happens in a Deno sandbox that has network access only to the base URL for the API. + ### Specifying the MCP Client Different clients have varying abilities to handle arbitrary tools and schemas. @@ -128,6 +164,45 @@ over time, you can manually enable or disable certain capabilities: --resource=cards,accounts --operation=read --tag=kyc --no-tool=create_cards ``` +## Running remotely + +Launching the client with `--transport=http` launches the server as a remote server using Streamable HTTP transport. The `--port` setting can choose the port it will run on, and the `--socket` setting allows it to run on a Unix socket. + +Authorization can be provided via the `Authorization` header using the Bearer scheme. + +Additionally, authorization can be provided via the following headers: +| Header | Equivalent client option | Security scheme | +| ----------------- | ------------------------ | --------------- | +| `x-julep-api-key` | `apiKey` | APIKeyHeader | + +A configuration JSON for this server might look like this, assuming the server is hosted at `http://localhost:3000`: + +```json +{ + "mcpServers": { + "julep_sdk_api": { + "url": "http://localhost:3000", + "headers": { + "Authorization": "Bearer " + } + } + } +} +``` + +The command-line arguments for filtering tools and specifying clients can also be used as query parameters in the URL. +For example, to exclude specific tools while including others, use the URL: + +``` +http://localhost:3000?resource=cards&resource=accounts&no_tool=create_cards +``` + +Or, to configure for the Cursor client, with a custom max tool name length, use the URL: + +``` +http://localhost:3000?client=cursor&capability=tool-name-length%3D40 +``` + ## Importing the tools and server individually ```js diff --git a/packages/mcp-server/build b/packages/mcp-server/build index b6db4f70..8af7357b 100644 --- a/packages/mcp-server/build +++ b/packages/mcp-server/build @@ -30,3 +30,27 @@ cp tsconfig.dist-src.json dist/src/tsconfig.json chmod +x dist/index.js DIST_PATH=./dist PKG_IMPORT_PATH=@julep/sdk-mcp/ node ../../scripts/utils/postprocess-files.cjs + +# mcp bundle +rm -rf dist-bundle julep_sdk_api.mcpb; mkdir dist-bundle + +# copy package.json +PKG_JSON_PATH=../../packages/mcp-server/package.json node ../../scripts/utils/make-dist-package-json.cjs > dist-bundle/package.json + +# copy files +node scripts/copy-bundle-files.cjs + +# install runtime deps +cd dist-bundle +npm install +cd .. + +# pack bundle +cp manifest.json dist-bundle + +npx mcpb pack dist-bundle julep_sdk_api.mcpb + +npx mcpb sign julep_sdk_api.mcpb --self-signed + +# clean up +rm -rf dist-bundle diff --git a/packages/mcp-server/cloudflare-worker/biome.json b/packages/mcp-server/cloudflare-worker/biome.json index ecd40b64..13b23ad3 100644 --- a/packages/mcp-server/cloudflare-worker/biome.json +++ b/packages/mcp-server/cloudflare-worker/biome.json @@ -1,34 +1,34 @@ { - "$schema": "https://biomejs.dev/schemas/1.6.2/schema.json", - "organizeImports": { - "enabled": true - }, - "files": { - "ignore": ["worker-configuration.d.ts"] - }, - "vcs": { - "enabled": true, - "clientKind": "git", - "useIgnoreFile": true - }, - "linter": { - "enabled": true, - "rules": { - "recommended": true, - "suspicious": { - "noExplicitAny": "off", - "noDebugger": "off", - "noConsoleLog": "off", - "noConfusingVoidType": "off" - }, - "style": { - "noNonNullAssertion": "off" - } - } - }, - "formatter": { - "enabled": true, - "indentWidth": 4, - "lineWidth": 100 - } + "$schema": "https://biomejs.dev/schemas/1.6.2/schema.json", + "organizeImports": { + "enabled": true + }, + "files": { + "ignore": ["worker-configuration.d.ts"] + }, + "vcs": { + "enabled": true, + "clientKind": "git", + "useIgnoreFile": true + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true, + "suspicious": { + "noExplicitAny": "off", + "noDebugger": "off", + "noConsoleLog": "off", + "noConfusingVoidType": "off" + }, + "style": { + "noNonNullAssertion": "off" + } + } + }, + "formatter": { + "enabled": true, + "indentWidth": 4, + "lineWidth": 100 + } } diff --git a/packages/mcp-server/cloudflare-worker/package.json b/packages/mcp-server/cloudflare-worker/package.json index 52f35f0a..db5ed7a1 100644 --- a/packages/mcp-server/cloudflare-worker/package.json +++ b/packages/mcp-server/cloudflare-worker/package.json @@ -18,7 +18,7 @@ }, "dependencies": { "@cloudflare/workers-oauth-provider": "^0.0.5", - "@modelcontextprotocol/sdk": "^1.11.4", + "@modelcontextprotocol/sdk": "^1.24.0", "agents": "^0.0.88", "hono": "^4.7.9", "@julep/sdk-mcp": "latest", diff --git a/packages/mcp-server/cloudflare-worker/src/utils.ts b/packages/mcp-server/cloudflare-worker/src/utils.ts index 5803d74a..866cb172 100644 --- a/packages/mcp-server/cloudflare-worker/src/utils.ts +++ b/packages/mcp-server/cloudflare-worker/src/utils.ts @@ -300,11 +300,12 @@ export const renderLoggedOutAuthorizeScreen = async ( class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary" > +