Skip to main content

langchain-simplepages

LangChain tools for Simplepages, an AI landing page and website builder. Your agent can build a page, edit it, and read how it performed.

The package is a thin adapter over the hosted Simplepages MCP server. It discovers whatever tools the server advertises and hands them back as ordinary LangChain BaseTool objects, with names, descriptions and JSON schemas passed through untouched.

Install

pip install langchain-simplepages

Get a token

Sign in to Simplepages, open Settings > MCP access, and generate a token. Then:

export SIMPLEPAGES_TOKEN="..."

Full details at simplepages.ai/mcp.

Use it

import asyncio
from langchain.agents import create_agent
from langchain_simplepages import SimplepagesToolkit


async def main():
    tools = await SimplepagesToolkit().get_tools()
    agent = create_agent("claude-sonnet-4-5-20250929", tools=tools)
    result = await agent.ainvoke(
        {
            "messages": [
                {
                    "role": "user",
                    "content": "Build a landing page for a Leeds accounting firm that files "
                    "year-end tax returns for freelancers. CTA: book a 20-minute call.",
                }
            ]
        }
    )
    print(result["messages"][-1].content)


asyncio.run(main())

SimplepagesToolkit() reads SIMPLEPAGES_TOKEN from the environment. Pass api_key="..." to override it.

Tools

Tool Read-only What it does
create_page no Generates a new landing page (HTML and AI images) from a description. Saved as a draft.
edit_page no Changes an existing page from a plain-language instruction. Saved to the draft.
list_pages yes Lists standalone landing pages, with publish status and URLs.
list_sites yes Lists multi-page websites, including each site's pages.
get_page yes Returns one page's name, status, edit URL and live URL.
get_page_analytics yes Visitors, views, traffic sources, devices, countries, leads and revenue for one page.
get_workspace_analytics yes Workspace-wide totals and a per-page ranking by visitors and leads.

Nothing publishes on its own. create_page and edit_page write to a draft. A page goes live only when someone publishes it from the Simplepages dashboard, so an agent that gets carried away cannot put anything in front of your visitors.

Restricting the tool set

tool_filter takes a collection of names or a predicate. To give an agent read access and nothing more:

toolkit = SimplepagesToolkit(
    tool_filter=[
        "list_pages",
        "list_sites",
        "get_page",
        "get_page_analytics",
        "get_workspace_analytics",
    ],
)

Configuration

Argument Default Notes
api_key $SIMPLEPAGES_TOKEN Stored as a SecretStr, so it stays out of reprs and logs.
base_url https://simplepages.ai/api/mcp Point at staging or a self-hosted server.
tool_filter None Names to keep, or a Callable[[BaseTool], bool].
timeout 120.0 Per-request HTTP timeout in seconds. Page generation is slow.
sse_read_timeout 300.0 Idle timeout for the event stream, in seconds.

Sync code

get_tools() is async, because the MCP client underneath is. From synchronous code, use get_tools_sync():

tools = SimplepagesToolkit().get_tools_sync()

It raises if called from inside a running event loop, where blocking on the async client would deadlock. Await get_tools() there instead.

Errors

A missing or rejected token raises SimplepagesAuthError (a ValueError) naming the environment variable and where to generate a replacement. Everything else, including network failures and server errors, propagates unchanged.

Requirements

Python 3.10 or newer, which is the floor set by langchain-mcp-adapters.

Development

uv sync --all-groups
uv run pytest tests/unit_tests    # no network, no credentials
uv run ruff check .
uv run mypy langchain_simplepages

Integration tests hit the real server and are skipped unless a token is present:

SIMPLEPAGES_TOKEN=... uv run pytest tests/integration_tests

Links

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_simplepages-0.1.0.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_simplepages-0.1.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file langchain_simplepages-0.1.0.tar.gz.

File metadata

File hashes

Hashes for langchain_simplepages-0.1.0.tar.gz
Algorithm Hash digest
SHA256 aa9e31af26819b03369f6df2c4d083b9c64eb873fcab33a6d9cdc1538b3ceb10
MD5 4a7d2e37fc67cd007c34c0f0fb96e27a
BLAKE2b-256 02a866dab605beae439379ff2a8ee6923197ff80d8ffb4cd3400ae94eeaa96ce

See more details on using hashes here.

File details

Details for the file langchain_simplepages-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_simplepages-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db265964f506f162bfd688ead4b2a4a3898ac27dad0ae4dbeb052911cbaac9ff
MD5 d7ad9c44b7dd801e238fcdf233a8782c
BLAKE2b-256 579f6dcda4d3a5639ab436d3ec1750bf19a16a8235f217e5bd7e91c5c873d6ff

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page