modelcontextprotocol / modelcontextprotocol/typescript-sdk

Cannot load a basic STDIO MCP server (JS) in claude desktop

Open
#419 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs confirmation potentially close question
Dominant language
TypeScript
Stars
13.4k
Forks
2.2k
Avg merge
3d 15h
Merged PRs (30d)
4

Description

Hi,

I have a basic STDIO server written in JS.
The file begins as follows:

import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
import { chromium } from "playwright";
import fs from "fs";
import path from "path";
import babel from '@babel/core';
import presetEnv from '@babel/preset-env';
import { fileURLToPath } from 'url';

....
....
console.log('Starting server...');

But when I load it into Claude using this config:

{
	"mcpServers": {
		"pageAnalyzer": {			
			"command": "node",
      		"args": [
        		"/Users/benbracha/workspace/evinced/mcp-servers/page-analyzer-mcp-server/src/server.js"
        	]      		
		}	  
	}
}

I get the following error in Claude logs:

import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
       ^

SyntaxError: Unexpected token {

Mind that running it in MCP Inspector v0.10.2 it just works....

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Claude MCP configuration and the referenced src/server.js entry point, then compare how the same server is launched by MCP Inspector v0.10.2. Reproduce the syntax error with the logged node command and determine why Claude cannot load the shown ES module imports; done means the basic STDIO server loads in Claude without the syntax error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
backend, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.