[WIP] Refactor everything server to be more modular and use recommended APIs.

* 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
This commit is contained in:
cliffhall
2025-12-05 13:26:08 -05:00
parent 8845118d61
commit 1c64b36c78
17 changed files with 904 additions and 527 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@modelcontextprotocol/server-everything",
"version": "0.6.2",
"version": "2.0.0",
"description": "MCP server that exercises all the features of the MCP protocol",
"license": "MIT",
"mcpName": "io.github.modelcontextprotocol/server-everything",
@@ -19,12 +19,14 @@
"dist"
],
"scripts": {
"build": "tsc && shx cp instructions.md dist/ && shx chmod +x dist/*.js",
"build": "tsc && shx cp -r docs dist/ && shx chmod +x dist/*.js",
"prepare": "npm run build",
"watch": "tsc --watch",
"start:stdio": "node dist/index.js stdio",
"start:sse": "node dist/index.js sse",
"start:streamableHttp": "node dist/index.js streamableHttp"
"start:streamableHttp": "node dist/index.js streamableHttp",
"prettier-fix": "prettier --write .",
"prettier-check": "prettier --check ."
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.24.0",
@@ -38,6 +40,7 @@
"@types/cors": "^2.8.19",
"@types/express": "^5.0.6",
"shx": "^0.3.4",
"typescript": "^5.6.2"
"typescript": "^5.6.2",
"prettier": "^2.8.8"
}
}