[PR #1606] [CLOSED] Refactor MCP client code to use async main function #1687

Closed
opened 2026-02-17 17:22:37 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/docs/pull/1606
Author: @NiranjanAP
Created: 11/24/2025
Status: Closed

Base: mainHead: patch-5


📝 Commits (1)

  • ee2b843 Refactor MCP client code to use async main function

📊 Changes

1 file changed (+33 additions, -27 deletions)

View changed files

📝 src/oss/langchain/mcp.mdx (+33 -27)

📄 Description

Original code would fail because the await is outside of a function

tools = await client.get_tools()  
        ^^^^^^^^^^^^^^^^^^^^^^^^

SyntaxError: 'await' outside function

fixed this issue.

Also, this code won't work without the servers running, mentioned the same in the comment

Overview

Type of change

Type: [Replace with: New documentation page / Update existing documentation / Fix typo/bug/link/formatting / Remove outdated content / Other]

Related issues/PRs

  • GitHub issue:
  • Feature PR:
  • Linear issue:
  • Slack thread:

Checklist

  • I have read the contributing guidelines
  • I have tested my changes locally using docs dev
  • All code examples have been tested and work correctly
  • I have used root relative paths for internal links
  • I have updated navigation in src/docs.json if needed

(Internal team members only / optional): Create a preview deployment as necessary using the Create Preview Branch workflow

Additional notes


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/docs/pull/1606 **Author:** [@NiranjanAP](https://github.com/NiranjanAP) **Created:** 11/24/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `patch-5` --- ### 📝 Commits (1) - [`ee2b843`](https://github.com/langchain-ai/docs/commit/ee2b843f890e07e26daf1b13207dd821d7f94823) Refactor MCP client code to use async main function ### 📊 Changes **1 file changed** (+33 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `src/oss/langchain/mcp.mdx` (+33 -27) </details> ### 📄 Description Original code would fail because the await is outside of a function tools = await client.get_tools() ^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: 'await' outside function fixed this issue. Also, this code won't work without the servers running, mentioned the same in the comment ## Overview <!-- Brief description of what documentation is being added/updated --> ## Type of change **Type:** [Replace with: New documentation page / Update existing documentation / Fix typo/bug/link/formatting / Remove outdated content / Other] ## Related issues/PRs <!-- Link to related issues, feature PRs, or discussions (if applicable) To automatically close an issue when this PR is merged, use closing keywords: - "closes #123" or "fixes #123" or "resolves #123" For regular references without auto-closing, just use: - "#123" or "See issue #123" Examples: - closes #456 (will auto-close issue #456 when PR is merged) - See #789 for context (will reference but not auto-close issue #789) --> - GitHub issue: - Feature PR: <!-- For LangChain employees, if applicable: --> - Linear issue: - Slack thread: ## Checklist <!-- Put an 'x' in all boxes that apply --> - [x] I have read the [contributing guidelines](README.md) - [x] I have tested my changes locally using `docs dev` - [x] All code examples have been tested and work correctly - [x] I have used **root relative** paths for internal links - [x] I have updated navigation in `src/docs.json` if needed (Internal team members only / optional): Create a preview deployment as necessary using the [Create Preview Branch workflow](https://github.com/langchain-ai/docs/actions/workflows/create-preview-branch.yml) ## Additional notes <!-- Any other information that would be helpful for reviewers --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-17 17:22:37 -05:00
yindo closed this issue 2026-02-17 17:22:37 -05:00
yindo changed title from [PR #1606] Refactor MCP client code to use async main function to [PR #1606] [CLOSED] Refactor MCP client code to use async main function 2026-06-05 18:14:22 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#1687