Frameworks & Orchestrators

Use Foldr with LangChain (MCP)

LangChain is the most widely used Python and JS framework for building LLM applications, with first-class agents, memory, and retrieval. The `langchain-mcp` adapter turns any MCP server into LangChain tools and toolkits. Foldr is the easiest way to give a LangChain agent a hosted-file side-effect without writing a custom tool.

LangChainPython, JavaScriptMCP: stable

Installation

Add the Foldr MCP server to LangChain with the snippet below. Replace fs_live_... with an API key from foldr.space/developers.

pip install langchain-mcp-adapters
# Python
from langchain_mcp_adapters.client import MultiServerMCPClient

client = MultiServerMCPClient({
    "foldr": {
        "command": "npx",
        "args": ["-y", "@foldr/mcp-server"],
        "env": {"FOLDR_API_KEY": "fs_live_..."},
        "transport": "stdio",
    }
})
tools = await client.get_tools()

Setup tip: Pass `tools` to any LangChain/LangGraph agent. Also available for LangChain JS via @langchain/mcp-adapters.

Official LangChain MCP docs

What You Can Do

  • Upload any file from LangChain to Foldr and get a shareable URL back in the same turn
  • Shorten long URLs to foldr.space/s/... links without leaving LangChain
  • Create or update a Foldr bio page from a LangChain conversation
  • Generate a hosted Foldr form and paste the submission URL into your reply
  • Wire Foldr tools into any existing LangChain agent with a few lines of config

LangChain + Foldr FAQ

How do I install the Foldr MCP server in LangChain?

Open LangChain's MCP configuration (the CLI) and paste the config block shown above. Set FOLDR_API_KEY to a key you create at foldr.space/api-keys. Restart LangChain if it doesn't hot-reload.

Which Foldr plan do I need to use the MCP integration with LangChain?

The Foldr MCP server is available on every paid plan (Pro from $5/mo and Developer tier for API-heavy usage). The free tier can generate temporary 7-day links; for permanent storage, a Pro plan or Foldr Space is required.

I set the key but LangChain says the Foldr tool isn't available — what's wrong?

The two most common issues: (1) LangChain wasn't restarted after editing the config — most MCP hosts need a restart to pick up new servers. (2) Your API key is missing the `mcp:invoke` scope. Regenerate a key at foldr.space/api-keys with full scope and retry.

Can LangChain upload files directly to Foldr, or just generate URLs?

LangChain can do both. The MCP server exposes tools for `upload_file` (takes a local path or base64 blob), `shorten_url`, and `create_bio_page`. Any file LangChain can read from disk can be uploaded.

Is the Foldr MCP integration with LangChain production-ready?

Foldr's MCP server is stable and used in production. LangChain's MCP support is currently stable and generally available. We pin to stable SDK versions and publish changelog entries for every breaking change.

Related MCP Integrations

Connect LangChain to Foldr in under a minute

Grab an API key, paste the snippet above into LangChain's MCP config, and your agent can upload files and share URLs immediately.

Get your Foldr API key