Skip to content

Commit e2005fe

Browse files
authored
Update README with correct paths and current project structure (#2)
* Fix all references from dist/index.js to dist/index.mjs * Prioritize npm/npx installation over building from source * Update project structure to include tests/ and .github/ directories * Add missing configuration files (vitest.config.ts, tsconfig.test.json) * Remove non-existent .prettierrc from structure * Fix npm run watch to npm run dev * Add missing npm scripts to development workflow (test, lint, format) * Update VS Code and Cursor setup to show npx as primary method * Remove outdated future enhancements (npm publish, test suite)
1 parent ccfa43f commit e2005fe

File tree

1 file changed

+88
-24
lines changed

1 file changed

+88
-24
lines changed

README.md

Lines changed: 88 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,27 @@ An MCP (Model Context Protocol) server that acts as a proxy between IDEs and the
2626

2727
## Prerequisites
2828

29-
- `Node.js` 18 or higher
29+
- `Node.js` 22 or higher
3030
- `mcpd` daemon running and accessible
3131
- `mcpd` SDK (automatically installed as a dependency)
3232

3333
## Installation
3434

35+
### From npm (Recommended)
36+
37+
```bash
38+
# Global installation
39+
npm install -g @mozilla-ai/mcpd-proxy
40+
41+
# Or use directly with npx
42+
npx @mozilla-ai/mcpd-proxy
43+
```
44+
45+
### From Source
46+
3547
```bash
36-
# Clone or navigate to the project directory
48+
# Clone the repository
49+
git clone https://github.com/mozilla-ai/mcpd-proxy.git
3750
cd mcpd-proxy
3851

3952
# Install dependencies
@@ -57,33 +70,50 @@ npm run build
5770
### Running Directly
5871

5972
```bash
60-
# With default configuration
61-
node dist/index.js
73+
# Using npm package (recommended)
74+
npx @mozilla-ai/mcpd-proxy
6275

6376
# With custom mcpd address
64-
MCPD_ADDR=http://localhost:8090 node dist/index.js
77+
MCPD_ADDR=http://localhost:8090 npx @mozilla-ai/mcpd-proxy
6578

6679
# With API key
67-
MCPD_ADDR=http://localhost:8090 MCPD_API_KEY=your-key node dist/index.js
80+
MCPD_ADDR=http://localhost:8090 MCPD_API_KEY=your-key npx @mozilla-ai/mcpd-proxy
81+
82+
# From source build
83+
node dist/index.mjs
84+
85+
# From source with custom address
86+
MCPD_ADDR=http://localhost:8090 node dist/index.mjs
6887
```
6988

7089
### VS Code Setup
7190

72-
Build the project:
91+
Add to your VS Code MCP settings file (location varies by platform):
7392

74-
```bash
75-
npm run build
93+
```json
94+
{
95+
"servers": {
96+
"mcpd": {
97+
"type": "stdio",
98+
"command": "npx",
99+
"args": ["@mozilla-ai/mcpd-proxy"],
100+
"env": {
101+
"MCPD_ADDR": "http://localhost:8090"
102+
}
103+
}
104+
}
105+
}
76106
```
77107

78-
Add to your VS Code MCP settings file (location varies by platform):
108+
Or if building from source:
79109

80110
```json
81111
{
82112
"servers": {
83113
"mcpd": {
84114
"type": "stdio",
85115
"command": "node",
86-
"args": ["<path-to-mcpd-proxy>/dist/index.js"],
116+
"args": ["<path-to-mcpd-proxy>/dist/index.mjs"],
87117
"env": {
88118
"MCPD_ADDR": "http://localhost:8090"
89119
}
@@ -100,20 +130,30 @@ Verify the connection in the MCP panel to see available tools.
100130

101131
### Cursor Setup
102132

103-
Build the project:
133+
Create or edit `.cursor/mcp.json` in your project directory, or `~/.cursor/mcp.json` for global configuration:
104134

105-
```bash
106-
npm run build
135+
```json
136+
{
137+
"mcpServers": {
138+
"mcpd": {
139+
"command": "npx",
140+
"args": ["@mozilla-ai/mcpd-proxy"],
141+
"env": {
142+
"MCPD_ADDR": "http://localhost:8090"
143+
}
144+
}
145+
}
146+
}
107147
```
108148

109-
Create or edit `.cursor/mcp.json` in your project directory, or `~/.cursor/mcp.json` for global configuration:
149+
Or if building from source:
110150

111151
```json
112152
{
113153
"mcpServers": {
114154
"mcpd": {
115155
"command": "node",
116-
"args": ["<path-to-mcpd-proxy>/dist/index.js"],
156+
"args": ["<path-to-mcpd-proxy>/dist/index.mjs"],
117157
"env": {
118158
"MCPD_ADDR": "http://localhost:8090"
119159
}
@@ -126,6 +166,8 @@ Replace `<path-to-mcpd-proxy>` with the absolute path to your installation, or u
126166

127167
Reload Cursor to apply the configuration.
128168

169+
See `examples/` folder for configuration examples.
170+
129171
## Development
130172

131173
### Project Structure
@@ -137,15 +179,27 @@ mcpd-proxy/
137179
│ ├── server.ts # MCP server implementation
138180
│ ├── config.ts # Configuration loader
139181
│ └── apiPaths.ts # API endpoint constants
140-
├── dist/ # Build output (gitignored)
182+
├── tests/
183+
│ └── unit/ # Unit test files
184+
│ ├── apiPaths.test.ts
185+
│ ├── config.test.ts
186+
│ └── parsers.test.ts
187+
├── .github/
188+
│ └── workflows/ # GitHub Actions workflows
189+
│ ├── tests.yaml
190+
│ ├── lint.yaml
191+
│ └── release.yaml
141192
├── examples/
142193
│ ├── vscode-config.json # VS Code configuration example
143194
│ └── cursor-config.json # Cursor configuration example
195+
├── dist/ # Build output (gitignored)
144196
├── package.json # npm package configuration
145197
├── package-lock.json # npm dependency lock file
146198
├── tsconfig.json # TypeScript compiler configuration
199+
├── tsconfig.test.json # TypeScript test configuration
200+
├── vitest.config.ts # Vitest test configuration
201+
├── vite.config.mts # Vite build configuration
147202
├── eslint.config.mts # ESLint configuration
148-
├── .prettierrc # Prettier code formatter config
149203
├── .prettierignore # Prettier ignore patterns
150204
├── .gitignore # Git ignore patterns
151205
└── README.md # This file
@@ -161,10 +215,22 @@ npm install
161215
npm run build
162216

163217
# Watch mode (auto-rebuild on changes)
164-
npm run watch
218+
npm run dev
219+
220+
# Run tests
221+
npm test
222+
223+
# Run tests in watch mode
224+
npm run test:watch
165225

166226
# Type check without building
167227
npm run typecheck
228+
229+
# Lint code
230+
npm run lint
231+
232+
# Format code
233+
npm run format
168234
```
169235

170236
### Manual Testing
@@ -173,10 +239,10 @@ Test the MCP protocol directly using `JSON-RPC` over `stdio`:
173239

174240
```bash
175241
# Test initialize
176-
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}' | node dist/index.js
242+
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}' | node dist/index.mjs
177243

178244
# Test list tools
179-
echo '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' | node dist/index.js
245+
echo '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' | node dist/index.mjs
180246
```
181247

182248
## Naming Conventions
@@ -267,7 +333,7 @@ Cause: VS Code may not have recognized the MCP server
267333
Solution:
268334

269335
1. Check VS Code developer console for errors (Help → Toggle Developer Tools)
270-
2. Verify the path to `dist/index.js` is correct and absolute
336+
2. Verify the path to `dist/index.mjs` is correct and absolute (if building from source)
271337
3. Reload VS Code: `Cmd+Shift+P` → "Developer: Reload Window"
272338
4. Check `mcpd` daemon is running and accessible
273339

@@ -302,8 +368,6 @@ API key: not set
302368
- Dynamic tool list updates (`notifications/tools/list_changed`)
303369
- Server filtering via `MCPD_SERVERS` environment variable
304370
- Improved unhealthy server handling
305-
- Comprehensive test suite
306-
- Publish to `npm` for `npx` usage
307371

308372
## Related Projects
309373

0 commit comments

Comments
 (0)