The EVO Payment MCP server defines a set of tools that AI agents can use to interact with the EVO Payment API.
Explore this SDK to integrate EVO Payment into agentic workflows. Because agent behavior is non-deterministic, use the SDK in a sandbox and run evaluations to assess your application’s performance.
Before using LinkPay MCP, you need to configure the following environment variables:
| Environment Variable | Description | Required |
|---|---|---|
EVOCLOUD_BASE_URL | EvoCloud API base URL (defaults to UAT service) | Yes |
EVOCLOUD_SID | EvoCloud merchant ID | Yes |
EVOCLOUD_SIGN_KEY | EvoCloud signature key | Yes |
EVOCLOUD_WEBHOOK_URL | Payment callback URL | No |
Add the following configuration to your MCP client configuration file:
{
"mcpServers": {
"linkpay": {
"command": "uvx",
"args": ["--from", "evocloud_agent_toolkit", "linkpaymcp", "stdio"],
"env": {
"EVOCLOUD_BASE_URL": "https://counter-uat.everonet.com",
"EVOCLOUD_SID": "Your merchant ID",
"EVOCLOUD_SIGN_KEY": "Your signature key",
"EVOCLOUD_WEBHOOK_URL": "https://example.com/webhook"
}
}
}
}
LinkPay MCP provides the following core features:
generate_merchant_order_idprefix (optional): Order ID prefix, defaults to "LINKPAY"create_linkpay_ordermerchant_order_id (required): Merchant order IDcurrency (required): Currency code, e.g., "USD", "CNY"amount (required): Payment amountmerchant_order_time (optional): Order timegoods_name (optional): Product namegoods_description (optional): Product descriptiontrade_type (optional): Transaction typereturn_url (optional): Return URL after payment completionwebhook_url (optional): Payment status callback URLenabled_payment_methods (optional): List of supported payment methodsvalid_time (optional): Order validity time (minutes)query_linkpay_ordermerchant_order_id (required): Merchant order IDcreate_linkpay_refundoriginal_merchant_order_id (required): Original order IDmerchant_trans_id (required): Refund transaction IDcurrency (required): Currency coderefund_amount (required): Refund amountmerchant_trans_time (optional): Refund timereason (optional): Refund reasondescription (optional): Refund descriptionquery_linkpay_refundmerchant_trans_id (required): Refund transaction IDConfigure the service as follows:
Save the configuration and check if the LinkPay service is running normally in the MCP tools list
EVOCLOUD_SIGN_KEY is stored securely, do not hardcode in the source codemerchant_order_id does not create duplicate ordersLearn how to build your AI agent with the EVO Payment Agent Toolkit.
Explore this SDK to integrate EVO Payment into agentic workflows. Because agent behavior is non-deterministic, use the SDK in a sandbox and run evaluations to assess your application’s performance.
pip install evocloud-agent-toolkit langchain langchain-openai
cp env.example .env
# Edit the .env file and fill in your actual configuration
EVOCLOUD_BASE_URL=https://online-uat.everonet.com
EVOCLOUD_SIGN_KEY=your_sign_key
EVOCLOUD_SID=your_sid
EVOCLOUD_WEBHOOK_URL=https://your-domain.com/webhook # optional
OPENAI_API_KEY=your_openai_api_key
from evocloud_agent_toolkit.langchain import EvoCloudToolkit
from langchain.agents import create_openai_functions_agent, AgentExecutor
from langchain.prompts import ChatPromptTemplate, MessagesPlaceholder
from langchain_openai import ChatOpenAI
# Initialize toolkit and model
toolkit = EvoCloudToolkit()
tools = toolkit.get_tools()
llm = ChatOpenAI(model="gpt-4", temperature=0)
# Create prompt template
prompt = ChatPromptTemplate.from_messages([
("system", "You are a professional payment assistant who can help users handle LinkPay-related business."),
("user", "{input}"),
MessagesPlaceholder(variable_name="agent_scratchpad")
])
# Create and run the Agent
agent = create_openai_functions_agent(llm, tools, prompt)
agent_executor = AgentExecutor(agent=agent, tools=tools)
# Interact via natural language
response = agent_executor.invoke({
"input": "Please create an order, order number ORDER_123, amount $99.99, product is Premium Service."
})
print(response["output"])