MCP Basics (Non-Engineer Track)

Goal

Create a new MCP server project with all the necessary configuration.

Prompt

Copy and paste this entire prompt into Cursor:

1Create a new MCP (Model Context Protocol) server project for me.
2
3Project location: Create in a new folder called `my-mcp-server` in my current workspace.
4
5Required structure:
6```
7my-mcp-server/
8├── .npmrc
9├── .gitignore
10├── package.json
11├── tsconfig.json
12└── src/
13    └── index.ts
14```
15
16.npmrc must contain:
17```
18registry=https://npm.autodesk.com/artifactory/api/npm/autodesk-npm-virtual
19```
20
21.gitignore must contain:
22```
23node_modules/
24dist/
25.env
26*.log
27```
28
29package.json must contain:
30```json
31{
32  "name": "my-mcp-server",
33  "version": "1.0.0",
34  "type": "module",
35  "main": "src/index.ts",
36  "scripts": {
37    "start": "npx -y ts-node --esm src/index.ts"
38  },
39  "dependencies": {
40    "@modelcontextprotocol/sdk": "^1.0.0",
41    "zod": "^3.22.0"
42  },
43  "devDependencies": {
44    "@types/node": "^20.0.0",
45    "ts-node": "^10.9.0",
46    "typescript": "^5.3.0"
47  }
48}
49```
50
51tsconfig.json must contain:
52```json
53{
54  "compilerOptions": {
55    "target": "ES2022",
56    "module": "NodeNext",
57    "moduleResolution": "NodeNext",
58    "esModuleInterop": true,
59    "strict": true,
60    "skipLibCheck": true,
61    "outDir": "./dist",
62    "rootDir": "./src"
63  },
64  "include": ["src/**/*"],
65  "exclude": ["node_modules"]
66}
67```
68
69src/index.ts must contain:
70```typescript
71import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
72import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
73
74const server = new McpServer({
75    name: 'my-mcp-server',
76    version: '1.0.0'
77});
78
79// Tools will be registered here
80
81const transport = new StdioServerTransport();
82await server.connect(transport);
83```
84
85After creating the files, run:
86```bash
87cd my-mcp-server
88npm install
89```
90
91Success criteria:
92- All five files are created (.npmrc, .gitignore, package.json, tsconfig.json, src/index.ts)
93- npm install completes without errors
94- The node_modules folder is created

Expected Outcome

After running this prompt, Cursor will:

  1. Create the my-mcp-server folder
  2. Create all configuration files with the correct content
  3. Run npm install to download dependencies

Troubleshooting

npm install fails with network error?

  • Check your internet connection
  • Try running npm install again manually

Permission denied errors?

  • Make sure you have write access to the current folder
  • Try creating the project in a different location

TypeScript errors showing in the editor?

  • This is normal before npm install completes
  • The errors should disappear after dependencies are installed

What These Files Do

File Purpose
.npmrc Points npm to the Autodesk registry
.gitignore Excludes node_modules and secrets from git
package.json Lists dependencies and scripts
tsconfig.json Configures TypeScript
src/index.ts Your server code (currently empty)