Skip to main content

Agents spending you can trust

Project description

Laissez

Agent spending you can trust

Quickstart

Create a paid MCP app

from fastmcp import FastMCP
import random

from laissez.server import PaidTool, create_paid_mcp_app


mcp = FastMCP("my-example-server")

@mcp.tool
def roll_die() -> int:
    return random.randint(1,6)

paid_tools = [
    PaidTool(name="roll_die", price=0.001, description="Rolls a die")
]

if __name__ == "__main__":
    import uvicorn
    import asyncio

    app = asyncio.run(create_paid_mcp_app(mcp, paid_tools))
    uvicorn.run(app, host="127.0.0.1", port=8000)

Create a paying MCP client

from pydantic_ai import Agent
from pydantic_ai.mcp import MCPServerStreamableHTTP
from dotenv import load_dotenv

from laissez.client import LaissezClient


load_dotenv()


BASE_URL = 'dice-roll.laissez.xyz'
laissez = LaissezClient()


server = MCPServerStreamableHTTP(
    url=f'{BASE_URL}/mcp',
    http_client=laissez
)


agent = Agent(
    model='openai:gpt-5-mini',
    instructions='Show your working out',
    toolsets=[server]
)


async def main():
    result = await agent.run("Roll a dice twice then multiply the two results and return the final result")

    print(result.output)


if __name__ == '__main__':
    asyncio.run(main())

Examples

The above quickstart can be found in examples/mcp. Be sure to:

  • Set OPENAI_API_KEY in .env if you are running the client
  • Set WALLET_PRIVATE_KEY in .env or follow the Laissez wizard to create a test account
  • Add faucet to your wallet by visiting https://faucet.circle.com, selecting Base Sepolia, and pasting your wallet address

Project details


Download files

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

Source Distribution

laissez-0.0.1a2.tar.gz (242.6 kB view details)

Uploaded Source

Built Distribution

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

laissez-0.0.1a2-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file laissez-0.0.1a2.tar.gz.

File metadata

  • Download URL: laissez-0.0.1a2.tar.gz
  • Upload date:
  • Size: 242.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.3

File hashes

Hashes for laissez-0.0.1a2.tar.gz
Algorithm Hash digest
SHA256 dd64a09d178c487be80017b653098f51618925204e5007a897303100e201ded4
MD5 b597318822d417b9670c1093592af28d
BLAKE2b-256 9a4de4dcc8b7b3aece092c7b3ad67ada5a8ec7c642ffed2e59f1d289471a4693

See more details on using hashes here.

File details

Details for the file laissez-0.0.1a2-py3-none-any.whl.

File metadata

  • Download URL: laissez-0.0.1a2-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.3

File hashes

Hashes for laissez-0.0.1a2-py3-none-any.whl
Algorithm Hash digest
SHA256 f6fc75d429bd33387648d29c7ab51d27a1e51a58f49eb76dda9820a41a81e105
MD5 33f197cfcc366df27f20731711dbee67
BLAKE2b-256 aa12cbdc1c3cf215de9abb0ca856ea48ad9d0e6cbbca612262764ff265483d7c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page