marble-headed-mcp 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +11 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5,15 +5,22 @@ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
5
5
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
6
6
  import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
7
7
  const DEFAULT_BASE_URL = 'http://localhost:4000';
8
- function resolveBaseUrl() {
8
+ function normalizeBaseUrl(input) {
9
+ return input.replace(/\/+$/, '');
10
+ }
11
+ function resolveRawBaseUrl() {
9
12
  const base = process.env.HEADED_SERVER_BASE_URL || DEFAULT_BASE_URL;
10
- return base.replace(/\/+$/, '');
13
+ return normalizeBaseUrl(base);
14
+ }
15
+ function resolveAppBaseUrl() {
16
+ const raw = resolveRawBaseUrl();
17
+ return raw.replace(/\/api\/headed\/?$/, '');
11
18
  }
12
19
  function buildUrl(pathname) {
13
- return `${resolveBaseUrl()}${pathname}`;
20
+ return `${resolveAppBaseUrl()}${pathname}`;
14
21
  }
15
22
  function buildHeadedUrl(pathname) {
16
- return buildUrl(`/api/headed${pathname}`);
23
+ return `${resolveAppBaseUrl()}/api/headed${pathname}`;
17
24
  }
18
25
  async function postJson(pathname, payload) {
19
26
  const response = await fetch(buildUrl(pathname), {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marble-headed-mcp",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "MCP server for Marble headed automation endpoints",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",