|
1 | | -# Node.js MCP Server Template |
| 1 | +# Computer MCP Server |
2 | 2 |
|
3 | | -A Model Context Protocol (MCP) server template for Node.js applications. This template provides a foundation for building MCP-compatible servers with support for multiple transport protocols. |
| 3 | +A computer mcp server |
4 | 4 |
|
5 | | -[![][npm-release-shield]][npm-release-link] |
6 | | -[![][codecov-shield]][codecov-link] |
7 | | -[![][github-release-date-shield]][github-release-date-link] |
8 | | -[![][github-action-build-shield]][github-action-build-link] |
9 | | -[![][github-license-shield]][github-license-link] |
| 5 | +## Setup |
10 | 6 |
|
11 | | -## Features |
12 | | -- Multiple Transport Protocols : |
| 7 | +### Usage |
| 8 | +To use with `Desktop APP`, such as Claude, VSCode, [Cline](https://cline.bot/mcp-marketplace), Cherry Studio, Cursor, and so on, add the MCP server config below. |
13 | 9 |
|
14 | | - - Standard I/O (stdio) for command-line interfaces |
15 | | - - HTTP Streamable transport for web applications |
16 | | - - Server-Sent Events (SSE) for real-time updates |
17 | | -- TypeScript Support : Built with TypeScript for type safety and better developer experience |
18 | | -- Development Tools : |
19 | | - |
20 | | - - Hot reloading during development |
21 | | - - Integration with MCP Inspector for debugging |
22 | | - - ESLint and Prettier for code quality |
23 | | - - Husky and lint-staged for Git hooks |
24 | | -- Extensible Tool System : Easy registration of custom MCP tools |
25 | | - |
26 | | -## Prerequisites |
27 | | -- Node.js (latest LTS version recommended) |
28 | | -- npm or yarn |
29 | | - |
30 | | -## Installation |
31 | | - |
32 | | -```bash |
33 | | -npm install |
34 | | -``` |
35 | | - |
36 | | -## Development |
37 | | -```bash |
38 | | -# Start development server with stdio transport |
39 | | -npm run dev |
40 | | - |
41 | | -# Start development server with web transport |
42 | | -npm run dev:web |
43 | | -``` |
44 | | - |
45 | | -When using dev:web , the server will be available at: |
46 | | - |
47 | | -- Streamable HTTP endpoint: http://localhost:8401/mcp |
48 | | -- SSE endpoint: http://localhost:8401/sse |
49 | | - |
50 | | -## Building |
51 | | -```bash |
52 | | -npm run build |
53 | | -``` |
54 | | -The build output will be in the build directory. |
55 | | - |
56 | | -## Usage |
57 | | -### Command Line |
58 | | -```bash |
59 | | -# Start with stdio transport (default) |
60 | | -node build/index.js |
61 | | - |
62 | | -# Start with web transport |
63 | | -node build/index.js web --port 8401 |
| 10 | +On Mac system: |
| 11 | +```json |
| 12 | +{ |
| 13 | + "mcpServers": { |
| 14 | + "computer-mcp-server": { |
| 15 | + "command": "npx", |
| 16 | + "args": [ |
| 17 | + "-y", |
| 18 | + "computer-mcp-server" |
| 19 | + ] |
| 20 | + } |
| 21 | + } |
| 22 | +} |
64 | 23 | ``` |
65 | | -### Adding Custom Tools |
66 | | -Custom tools can be added in the src/tools/index.ts file: |
67 | 24 |
|
68 | | -```ts |
69 | | -server.registerTool( |
70 | | - 'YourToolName', |
71 | | - { |
72 | | - title: 'Your Tool Name', |
73 | | - description: 'Tool description', |
74 | | - inputSchema: { |
75 | | - param1: z.string().describe('Parameter description'), |
76 | | - }, |
77 | | - }, |
78 | | - ({ param1 }) => { |
79 | | - // Implement tool logic |
80 | | - return { |
81 | | - content: [ |
82 | | - { |
83 | | - type: 'text', |
84 | | - text: `Your tool response: ${param1}`, |
85 | | - }, |
86 | | - ], |
| 25 | +On Window system: |
| 26 | + |
| 27 | +```json |
| 28 | +{ |
| 29 | + "mcpServers": { |
| 30 | + "computer-mcp-server": { |
| 31 | + "command": "cmd", |
| 32 | + "args": [ |
| 33 | + "/c", |
| 34 | + "npx", |
| 35 | + "-y", |
| 36 | + "computer-mcp-server" |
| 37 | + ] |
87 | 38 | } |
88 | | - }, |
89 | | -) |
| 39 | + } |
| 40 | +} |
90 | 41 | ``` |
91 | 42 |
|
92 | | -## Environment Variables |
93 | | -- PORT : Specify the port for web transport (default: 8401) |
94 | | -- NODE_ENV : Set to production for production builds or local for development |
95 | | - |
96 | 43 | ## License |
97 | 44 | [MIT](LICENSE) |
98 | | - |
99 | | -[npm-release-link]: https://www.npmjs.com/package/@my-mcp-hub/node-mcp-server |
100 | | -[npm-release-shield]: https://img.shields.io/npm/v/@my-mcp-hub/node-mcp-server?color=1677FF&labelColor=black&logo=npm&logoColor=white&style=flat-square |
101 | | -[codecov-link]: https://coveralls.io/github/my-mcp-hub/node-mcp-server?branch=main |
102 | | -[codecov-shield]: https://img.shields.io/coverallsCoverage/github/my-mcp-hub/node-mcp-server?color=1677FF&labelColor=black&style=flat-square&logo=codecov&logoColor=white |
103 | | -[github-release-date-link]: https://github.com/my-mcp-hub/node-mcp-server/releases |
104 | | -[github-release-date-shield]: https://img.shields.io/github/release-date/my-mcp-hub/node-mcp-server?color=1677FF&labelColor=black&style=flat-square |
105 | | -[github-action-build-link]: https://github.com/my-mcp-hub/node-mcp-server/actions/workflows/build.yml |
106 | | -[github-action-build-shield]: https://img.shields.io/github/actions/workflow/status/my-mcp-hub/node-mcp-server/build.yml?branch=main&color=1677FF&label=build&labelColor=black&logo=githubactions&logoColor=white&style=flat-square |
107 | | -[github-license-link]: https://github.com/my-mcp-hub/node-mcp-server/blob/main/LICENSE |
108 | | -[github-license-shield]: https://img.shields.io/github/license/my-mcp-hub/node-mcp-server?color=1677FF&labelColor=black&style=flat-square |
0 commit comments