Skip to content

langgraph-cli dev server starts but returns 404 on root and /docs, Studio fails to connect #1780

@nicobytes

Description

@nicobytes

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the LangGraph.js documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangGraph.js rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangGraph (or the specific integration package).

Example Code

This is my graph:

import {
  MessagesAnnotation,
  StateGraph,
  START,
  END,
} from '@langchain/langgraph';

const mockLlm = (_: typeof MessagesAnnotation.State) => {
  return { messages: [{ role: 'ai', content: 'hello world' }] };
};

export const graph = new StateGraph(MessagesAnnotation)
  .addNode('mock_llm', mockLlm)
  .addEdge(START, 'mock_llm')
  .addEdge('mock_llm', END)
  .compile();

Error Message and Stack Trace (if applicable)

Image

Description

I am trying to run a simple LangGraph application using the CLI development server. The terminal indicates that the server has started successfully and registered my graph. However, when I try to access the API documentation (/docs) or connect via LangGraph Studio, I get connection errors and 404 responses.

Image

Steps to Reproduce:

  1. Define a simple graph
  2. Run the dev server using npx @langchain/langgraph-cli dev (or via npm script).
  3. The terminal shows Server running at ::1:2024.
  4. Navigate to http://localhost:2024/docs or open the LangGraph Studio URL provided in the terminal.

System Info

Node version: v24.11.1
Operating system: darwin arm64
Package manager: npm
Package manager version: N/A

@langchain/core -> @1.0.5, , @"1.0.5", @"^1.0.5", @"^1.0.1", @"^0.3.59, @"^1.0.0"
langsmith -> @0.3.79, , @"~0.3.74", @"^0.3.33", @"^0.3.64"
zod -> @4.1.12, , @"^4.1.12", @"^3.25.76, @"^3.25, @"^3.25.32, @3.25.76, @"^3.19.1"
@langchain/langgraph-checkpoint-postgres -> @1.0.0, , @"1.0.0"
@langchain/langgraph-checkpoint -> @1.0.0, , @"^1.0.0", @"~0.0.16
@langchain/langgraph-cli -> @1.0.3, , @"1.0.3"
@langchain/langgraph-api -> @1.0.3, , @"1.0.3"
@langchain/langgraph-sdk -> @1.0.0, , @"~1.0.0", @"~0.0.16
@langchain/langgraph-ui -> @1.0.3, , @"1.0.3"
@langchain/langgraph -> @1.0.2, , @"1.0.2", @"^1.0.0", @"^0.2.57
@langchain/openai -> @1.1.2, , @"1.1.2"
langchain -> @1.0.5, , @"1.0.5"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions