Skip to content

Commit f3fd80e

Browse files
authored
Merge pull request #1027 from BobDickinson/tui-integration-design
Shared code architecture
2 parents 8cf0ac1 + d74d2fc commit f3fd80e

384 files changed

Lines changed: 59822 additions & 21117 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ node_modules
77
npm-debug.log
88

99
# Build artifacts
10-
client/dist
11-
client/build
12-
server/dist
13-
server/build
10+
web/dist
11+
cli/build
12+
tui/build
1413

1514
# Environment variables
1615
.env
@@ -32,4 +31,4 @@ coverage
3231

3332
# Docker
3433
Dockerfile
35-
.dockerignore
34+
.dockerignore

.github/workflows/cli_tests.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,17 @@ jobs:
2828
cd ..
2929
npm ci --ignore-scripts
3030
31+
- name: Build core package
32+
working-directory: .
33+
run: npm run build-core
34+
35+
- name: Build test package
36+
working-directory: .
37+
run: npm run build-test
38+
3139
- name: Build CLI
32-
run: npm run build
40+
working-directory: .
41+
run: npm run build-cli
3342

3443
- name: Run tests
3544
run: npm test

.github/workflows/core_tests.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Core Tests
2+
3+
on:
4+
push:
5+
paths:
6+
- "core/**"
7+
pull_request:
8+
paths:
9+
- "core/**"
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v6
16+
17+
- name: Set up Node.js
18+
uses: actions/setup-node@v6
19+
with:
20+
node-version-file: package.json
21+
cache: npm
22+
23+
- name: Install dependencies
24+
run: npm ci --ignore-scripts
25+
26+
- name: Build test package
27+
run: npm run build-test
28+
29+
- name: Build core
30+
run: npm run build-core
31+
32+
- name: Run core tests
33+
run: npm run test-core

.github/workflows/e2e_tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,17 @@ jobs:
5656
with:
5757
name: playwright-report
5858
path: |
59-
client/playwright-report/
60-
client/test-results/
61-
client/results.json
59+
web/playwright-report/
60+
web/test-results/
61+
web/results.json
6262
retention-days: 2
6363

6464
- name: Publish Playwright Test Summary
6565
uses: daun/playwright-report-summary@v3
6666
if: steps.playwright-tests.conclusion != 'skipped'
6767
with:
6868
create-comment: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
69-
report-file: client/results.json
69+
report-file: web/results.json
7070
comment-title: "🎭 Playwright E2E Test Results"
7171
job-summary: true
7272
icon-style: "emojis"

.github/workflows/main.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v6
1616

17-
- name: Check formatting
18-
run: npx prettier --check .
19-
2017
- uses: actions/setup-node@v6
2118
with:
2219
node-version-file: package.json
@@ -29,15 +26,14 @@ jobs:
2926
- name: Check version consistency
3027
run: npm run check-version
3128

32-
- name: Check linting
33-
working-directory: ./client
29+
- name: Lint
3430
run: npm run lint
3531

36-
- name: Run client tests
37-
working-directory: ./client
38-
run: npm test
32+
- name: Build
33+
run: npm run build
3934

40-
- run: npm run build
35+
- name: Run tests
36+
run: npm test
4137

4238
publish:
4339
runs-on: ubuntu-latest

.gitignore

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,29 @@
33
.idea
44
node_modules/
55
*-workspace/
6-
server/build
7-
client/dist
8-
client/tsconfig.app.tsbuildinfo
9-
client/tsconfig.node.tsbuildinfo
6+
web/tsconfig.app.tsbuildinfo
7+
web/tsconfig.node.tsbuildinfo
8+
web/tsconfig.jest.tsbuildinfo
9+
core/build
1010
cli/build
11+
tui/build
12+
test-servers/build
1113
test-output
1214
tool-test-output
1315
metadata-test-output
1416
# symlinked by `npm run link:sdk`:
1517
sdk
16-
client/playwright-report/
17-
client/results.json
18-
client/test-results/
19-
client/e2e/test-results/
20-
mcp.json
18+
web/playwright-report/
19+
web/results.json
20+
web/test-results/
21+
web/e2e/test-results/
22+
# Only ignore mcp.json at repo root (configs in configs/ are committed)
23+
/mcp.json
2124
.claude/settings.local.json
25+
26+
# Environment variables
27+
.env
28+
.env.local
29+
.env.development
30+
.env.test
31+
.env.production

.prettierignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
packages
2-
server/build
2+
core/build
3+
web/dist
4+
cli/build
5+
tui/build
6+
test-servers/build
37
CODE_OF_CONDUCT.md
48
SECURITY.md
59
mcp.json

AGENTS.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
## Build Commands
66

77
- Build all: `npm run build`
8-
- Build client: `npm run build-client`
9-
- Build server: `npm run build-server`
8+
- Build web: `npm run build-web`
109
- Development mode: `npm run dev` (use `npm run dev:windows` on Windows)
1110
- Format code: `npm run prettier-fix`
12-
- Client lint: `cd client && npm run lint`
11+
- Web lint: `cd web && npm run lint`
1312

1413
## Code Style Guidelines
1514

@@ -23,13 +22,15 @@
2322
- kebab-case for file names
2423
- Use async/await for asynchronous operations
2524
- Implement proper error handling with try/catch blocks
26-
- Use Tailwind CSS for styling in the client
25+
- Use Tailwind CSS for styling in the web app
2726
- Keep components small and focused on a single responsibility
2827

2928
## Project Organization
3029

3130
The project is organized as a monorepo with workspaces:
3231

33-
- `client/`: React frontend with Vite, TypeScript and Tailwind
34-
- `server/`: Express backend with TypeScript
32+
- `web/`: Web application (Vite, TypeScript, Tailwind)
33+
- `core/`: Core shared code used by web, CLI, and TUI
3534
- `cli/`: Command-line interface for testing and invoking MCP server methods directly
35+
- `tui/`: Terminal user interface
36+
- `test-servers/`: Composable MCP test servers, fixtures, and harness

Dockerfile

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ WORKDIR /app
77
# Copy package files for installation
88
COPY package*.json ./
99
COPY .npmrc ./
10-
COPY client/package*.json ./client/
11-
COPY server/package*.json ./server/
10+
COPY web/package*.json ./web/
11+
COPY core/package*.json ./core/
1212
COPY cli/package*.json ./cli/
13+
COPY tui/package*.json ./tui/
1314

1415
# Install dependencies
1516
RUN npm ci --ignore-scripts
@@ -28,25 +29,22 @@ WORKDIR /app
2829
# Copy package files for production
2930
COPY package*.json ./
3031
COPY .npmrc ./
31-
COPY client/package*.json ./client/
32-
COPY server/package*.json ./server/
32+
COPY web/package*.json ./web/
33+
COPY core/package*.json ./core/
3334
COPY cli/package*.json ./cli/
35+
COPY tui/package*.json ./tui/
3436

3537
# Install only production dependencies
3638
RUN npm ci --omit=dev --ignore-scripts
3739

3840
# Copy built files from builder stage
39-
COPY --from=builder /app/client/dist ./client/dist
40-
COPY --from=builder /app/client/bin ./client/bin
41-
COPY --from=builder /app/server/build ./server/build
41+
COPY --from=builder /app/web/dist ./web/dist
42+
COPY --from=builder /app/web/bin ./web/bin
4243
COPY --from=builder /app/cli/build ./cli/build
4344

44-
# Set default port values as environment variables
45-
ENV CLIENT_PORT=6274
46-
ENV SERVER_PORT=6277
45+
# Set default port
46+
ENV PORT=6274
47+
EXPOSE ${PORT}
4748

48-
# Document which ports the application uses internally
49-
EXPOSE ${CLIENT_PORT} ${SERVER_PORT}
50-
51-
# Use ENTRYPOINT with CMD for arguments
52-
ENTRYPOINT ["npm", "start"]
49+
# Run web app
50+
CMD ["node", "web/bin/start.js"]

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ The inspector runs both an MCP Inspector (MCPI) client UI (default port 6274) an
7272
CLIENT_PORT=8080 SERVER_PORT=9000 npx @modelcontextprotocol/inspector node build/index.js
7373
```
7474

75+
**Environment variables:** The client UI port is set with `CLIENT_PORT`. The sandbox (MCP apps) port prefers `MCP_SANDBOX_PORT`; `SERVER_PORT` is accepted for backward compatibility. If neither is set, a dynamic port is used.
76+
7577
For more details on ways to use the inspector, see the [Inspector section of the MCP docs site](https://modelcontextprotocol.io/docs/tools/inspector). For help with debugging, see the [Debugging guide](https://modelcontextprotocol.io/docs/tools/debugging).
7678

7779
### Servers File Export
@@ -182,7 +184,7 @@ The MCP Inspector proxy server requires authentication by default. When starting
182184
🔑 Session token: 3a1c267fad21f7150b7d624c160b7f09b0b8c4f623c7107bbf13378f051538d4
183185
184186
🔗 Open inspector with token pre-filled:
185-
http://localhost:6274/?MCP_PROXY_AUTH_TOKEN=3a1c267fad21f7150b7d624c160b7f09b0b8c4f623c7107bbf13378f051538d4
187+
http://localhost:6274/?MCP_INSPECTOR_API_TOKEN=3a1c267fad21f7150b7d624c160b7f09b0b8c4f623c7107bbf13378f051538d4
186188
```
187189

188190
This token must be included as a Bearer token in the Authorization header for all requests to the server. The inspector will automatically open your browser with the token pre-filled in the URL.
@@ -213,10 +215,10 @@ Read more about the risks of this vulnerability on Oligo's blog: [Critical RCE V
213215

214216
---
215217

216-
You can also set the token via the `MCP_PROXY_AUTH_TOKEN` environment variable when starting the server:
218+
You can also set the token via the `MCP_INSPECTOR_API_TOKEN` environment variable when starting the server (`MCP_PROXY_AUTH_TOKEN` is accepted for backward compatibility):
217219

218220
```bash
219-
MCP_PROXY_AUTH_TOKEN=$(openssl rand -hex 32) npm start
221+
MCP_INSPECTOR_API_TOKEN=$(openssl rand -hex 32) npm start
220222
```
221223

222224
#### Local-only Binding

0 commit comments

Comments
 (0)