Skip to content
This repository was archived by the owner on May 21, 2026. It is now read-only.
This repository was archived by the owner on May 21, 2026. It is now read-only.

Example code doesnt work #18

Description

@mrifni
Image

My sample code

// 1. Configure MCP servers
    const config = {
      mcpServers: {
        playwright: { command: "npx", args: ["@playwright/mcp@latest"] },
      },
    };
    const client = MCPClient.fromDict(config);

    const llm = new ChatOpenAI({ model: "gpt-4o", temperature: 0 });
    const agent = new MCPAgent({ llm: llm, client: client, maxSteps: 30 });

    const result = await agent.run(`Hello world`, 30);
    console.log(`\nResult: ${result}`);

my package.json file

"@langchain/openai": "^0.5.15",
"langchain": "^0.3.27",
"openai": "^5.12.2",
"mcp-use": "^0.1.11",
"@playwright/mcp": "^0.0.33",
"@modelcontextprotocol/sdk": "^1.17.2",

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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