fix: http port validation (#312)

* fix: validate and parse HTTP port as integer

Commander leaves --port as a string, so invalid values like abc previously
passed numeric range checks. Parse ports strictly before starting HTTP transport.

* test: add parsePort unit tests and npm test script

Introduce node:test coverage for HTTP port parsing edge cases using the
existing tsx dev dependency.

* docs: correct README port default and image search description

Align BRAVE_MCP_PORT default with runtime behavior (8080) and remove the
outdated v1.x base64 image search note.
This commit is contained in:
Sampson authored and GitHub committed 2026-06-24 07:58:51 -05:00
1 parent feeab77f13
commit e3f77ced06
5 files changed
+56 -3

No files matched your search

+1
View File
@@ -31,6 +31,7 @@
"watch": "tsc --watch",
"format": "prettier --write \"src/**/*.ts\"",
"format:check": "prettier --check \"src/**/*.ts\"",
"test": "node --import tsx --test \"src/**/*.test.ts\"",
"inspector": "npx @modelcontextprotocol/inspector",
"inspector:http": "npx @modelcontextprotocol/inspector --transport http"
},