mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-04-18 16:23:22 +02:00
* Adding static resources, move server instructions to
the new docs folder, and add code formatting
* Add docs folder
* Add docs/architecture.md which describes the architecture of the project thus far.
* Refactor moved instructions.md to docs/server-instructions.md
* Add resources/static.ts
- in addStaticResources()
- read the file entries from the docs folder
- register each file as a resource (no template), with a readResource function that reads the file and returns it in a contents block with the appropriate mime type and contents
- getMimeType helper function gets the mime type for a filename
- readSafe helper function reads the file synchronously as utf-8 or returns an error string
* Add resources/index.ts
- import addStaticResources
- export registerResources function
- in registerResources()
- call addStaticResources
* In package.json
- add prettier devDependency
- add prettier:check script
- add prettier:fix script
- in build script, copy docs folder to dist
* All other changes were prettier formatting
1.3 KiB
1.3 KiB
MCP "Everything" Server - Development Guidelines
Build, Test & Run Commands
- Build:
npm run build- Compiles TypeScript to JavaScript - Watch mode:
npm run watch- Watches for changes and rebuilds automatically - Run STDIO server:
npm run start:stdio- Starts the MCP server using stdio transport - Run SSE server:
npm run start:sse- Starts the MCP server with SSE transport - Run StreamableHttp server:
npm run start:stremableHttp- Starts the MCP server with StreamableHttp transport - Prepare release:
npm run prepare- Builds the project for publishing
Code Style Guidelines
- Use ES modules with
.jsextension in import paths - Strictly type all functions and variables with TypeScript
- Follow zod schema patterns for tool input validation
- Prefer async/await over callbacks and Promise chains
- Place all imports at top of file, grouped by external then internal
- Use descriptive variable names that clearly indicate purpose
- Implement proper cleanup for timers and resources in server shutdown
- Follow camelCase for variables/functions, PascalCase for types/classes, UPPER_CASE for constants
- Handle errors with try/catch blocks and provide clear error messages
- Use consistent indentation (2 spaces) and trailing commas in multi-line objects