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
- Simplepages MCP docs
- MCP server manifests
- Registry name:
ai.simplepages/simplepages
License
MIT
Metadata
Release files for langchain-simplepages 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| langchain_simplepages-0.1.0.tar.gz | 15.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| langchain_simplepages-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.6 kB
Release files / langchain_simplepages-0.1.0.tar.gz
| Download URL | langchain_simplepages-0.1.0.tar.gz |
|---|---|
| Size | 15.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aa9e31af26819b03369f6df2c4d083b9c64eb873fcab33a6d9cdc1538b3ceb10
|
|
BLAKE2b-256 checksum How to use checksums |
02a866dab605beae439379ff2a8ee6923197ff80d8ffb4cd3400ae94eeaa96ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.9
|
Release files / langchain_simplepages-0.1.0-py3-none-any.whl
| Download URL | langchain_simplepages-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
db265964f506f162bfd688ead4b2a4a3898ac27dad0ae4dbeb052911cbaac9ff
|
|
BLAKE2b-256 checksum How to use checksums |
579f6dcda4d3a5639ab436d3ec1750bf19a16a8235f217e5bd7e91c5c873d6ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.9
|