Skip to content

Commit f1f08bf

Browse files
chore: update SDK settings
1 parent 914fb2e commit f1f08bf

File tree

7 files changed

+102
-29
lines changed

7 files changed

+102
-29
lines changed

.github/workflows/publish-npm.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# This workflow is triggered when a GitHub release is created.
2+
# It can also be run manually to re-publish to NPM in case it failed for some reason.
3+
# You can run this workflow by navigating to https://www.github.com/stainless-api/dbahn-stations-typescript/actions/workflows/publish-npm.yml
4+
name: Publish NPM
5+
on:
6+
workflow_dispatch:
7+
inputs:
8+
path:
9+
description: The path to run the release in, e.g. '.' or 'packages/mcp-server'
10+
required: true
11+
12+
release:
13+
types: [published]
14+
15+
jobs:
16+
publish:
17+
name: publish
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: write
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Set up Node
26+
uses: actions/setup-node@v3
27+
with:
28+
node-version: '20'
29+
30+
- name: Set up pnpm
31+
uses: pnpm/action-setup@v4
32+
33+
- name: Install dependencies
34+
run: |
35+
pnpm install
36+
37+
- name: Publish to NPM
38+
run: |
39+
if [ -n "${{ github.event.inputs.path }}" ]; then
40+
PATHS_RELEASED='[\"${{ github.event.inputs.path }}\"]'
41+
else
42+
PATHS_RELEASED='[\".\", \"packages/mcp-server\"]'
43+
fi
44+
pnpm tsn scripts/publish-packages.ts "{ \"paths_released\": \"$PATHS_RELEASED\" }"
45+
env:
46+
NPM_TOKEN: ${{ secrets.DBAHN_STATIONS_NPM_TOKEN || secrets.NPM_TOKEN }}
47+
48+
- name: Upload MCP Server DXT GitHub release asset
49+
run: |
50+
gh release upload ${{ github.event.release.tag_name }} \
51+
packages/mcp-server/dbahn_stations_api.mcpb
52+
env:
53+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release-doctor.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ jobs:
1818
run: |
1919
bash ./bin/check-release-environment
2020
env:
21+
NPM_TOKEN: ${{ secrets.DBAHN_STATIONS_NPM_TOKEN || secrets.NPM_TOKEN }}
2122

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 4
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/references%2Fdbahn-stations-2a72886a1ec37a86550e3c5137230284269a32a606b28816e214905c8b06f677.yml
33
openapi_spec_hash: 7c2a8cbfc4afd14d0ea8dbb3c3eb2e6a
4-
config_hash: 5d8388386b6c9f4327ca7e907de5078f
4+
config_hash: 05f9ba56e7143961fa36c22bada6d450

CONTRIBUTING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,17 @@ To format and fix all lint issues automatically:
9191
```sh
9292
$ pnpm fix
9393
```
94+
95+
## Publishing and releases
96+
97+
Changes made to this repository via the automated release PR pipeline should publish to npm automatically. If
98+
the changes aren't made through the automated pipeline, you may want to make releases manually.
99+
100+
### Publish with a GitHub workflow
101+
102+
You can release to package managers by using [the `Publish NPM` GitHub action](https://www.github.com/stainless-api/dbahn-stations-typescript/actions/workflows/publish-npm.yml). This requires a setup organization or repository secret to be set up.
103+
104+
### Publish manually
105+
106+
If you need to manually release a package, you can run the `bin/publish-npm` script with an `NPM_TOKEN` set on
107+
the environment.

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,9 @@ It is generated with [Stainless](https://www.stainless.com/).
1111
## Installation
1212

1313
```sh
14-
npm install git+ssh://[email protected]:stainless-api/dbahn-stations-typescript.git
14+
npm install dbahn-stations
1515
```
1616

17-
> [!NOTE]
18-
> Once this package is [published to npm](https://www.stainless.com/docs/guides/publish), this will become: `npm install dbahn-stations`
19-
2017
## Usage
2118

2219
The full API of this library can be found in [api.md](api.md).

bin/check-release-environment

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
errors=()
44

5+
if [ -z "${NPM_TOKEN}" ]; then
6+
errors+=("The NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets")
7+
fi
8+
59
lenErrors=${#errors[@]}
610

711
if [[ lenErrors -gt 0 ]]; then

packages/mcp-server/README.md

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,18 @@ It is generated with [Stainless](https://www.stainless.com/).
44

55
## Installation
66

7-
### Building
7+
### Direct invocation
88

9-
Because it's not published yet, clone the repo and build it:
9+
You can run the MCP Server directly via `npx`:
1010

1111
```sh
12-
git clone [email protected]:stainless-api/dbahn-stations-typescript.git
13-
cd dbahn-stations-typescript
14-
./scripts/bootstrap
15-
./scripts/build
16-
```
17-
18-
### Running
19-
20-
```sh
21-
# set env vars as needed
2212
export DBAHN_STATIONS_CLIENT_ID="My Client ID"
2313
export DBAHN_STATIONS_CLIENT_SECRET="My Client Secret"
24-
node ./packages/mcp-server/dist/index.js
14+
npx -y dbahn-stations-mcp@latest
2515
```
2616

27-
> [!NOTE]
28-
> Once this package is [published to npm](https://www.stainless.com/docs/guides/publish), this will become: `npx -y dbahn-stations-mcp`
29-
3017
### Via MCP Client
3118

32-
[Build the project](#building) as mentioned above.
33-
3419
There is a partial list of existing clients at [modelcontextprotocol.io](https://modelcontextprotocol.io/clients). If you already
3520
have a client, consult their documentation to install the MCP server.
3621

@@ -40,12 +25,8 @@ For clients with a configuration JSON, it might look something like this:
4025
{
4126
"mcpServers": {
4227
"dbahn_stations_api": {
43-
"command": "node",
44-
"args": [
45-
"/path/to/local/dbahn-stations-typescript/packages/mcp-server",
46-
"--client=claude",
47-
"--tools=all"
48-
],
28+
"command": "npx",
29+
"args": ["-y", "dbahn-stations-mcp", "--client=claude", "--tools=all"],
4930
"env": {
5031
"DBAHN_STATIONS_CLIENT_ID": "My Client ID",
5132
"DBAHN_STATIONS_CLIENT_SECRET": "My Client Secret"
@@ -55,6 +36,29 @@ For clients with a configuration JSON, it might look something like this:
5536
}
5637
```
5738

39+
### Cursor
40+
41+
If you use Cursor, you can install the MCP server by using the button below. You will need to set your environment variables
42+
in Cursor's `mcp.json`, which can be found in Cursor Settings > Tools & MCP > New MCP Server.
43+
44+
[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=dbahn-stations-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImRiYWhuLXN0YXRpb25zLW1jcCJdLCJlbnYiOnsiREJBSE5fU1RBVElPTlNfQ0xJRU5UX0lEIjoiU2V0IHlvdXIgREJBSE5fU1RBVElPTlNfQ0xJRU5UX0lEIGhlcmUuIiwiREJBSE5fU1RBVElPTlNfQ0xJRU5UX1NFQ1JFVCI6IlNldCB5b3VyIERCQUhOX1NUQVRJT05TX0NMSUVOVF9TRUNSRVQgaGVyZS4ifX0)
45+
46+
### VS Code
47+
48+
If you use MCP, you can install the MCP server by clicking the link below. You will need to set your environment variables
49+
in VS Code's `mcp.json`, which can be found via Command Palette > MCP: Open User Configuration.
50+
51+
[Open VS Code](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22dbahn-stations-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22dbahn-stations-mcp%22%5D%2C%22env%22%3A%7B%22DBAHN_STATIONS_CLIENT_ID%22%3A%22Set%20your%20DBAHN_STATIONS_CLIENT_ID%20here.%22%2C%22DBAHN_STATIONS_CLIENT_SECRET%22%3A%22Set%20your%20DBAHN_STATIONS_CLIENT_SECRET%20here.%22%7D%7D)
52+
53+
### Claude Code
54+
55+
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
56+
environment variables in Claude Code's `.claude.json`, which can be found in your home directory.
57+
58+
```
59+
claude mcp add --transport stdio dbahn_stations_api --env DBAHN_STATIONS_CLIENT_ID="Your DBAHN_STATIONS_CLIENT_ID here." DBAHN_STATIONS_CLIENT_SECRET="Your DBAHN_STATIONS_CLIENT_SECRET here." -- npx -y dbahn-stations-mcp
60+
```
61+
5862
## Exposing endpoints to your MCP Client
5963

6064
There are three ways to expose endpoints as tools in the MCP server:

0 commit comments

Comments
 (0)