docs: MCP
This commit is contained in:
@@ -8,8 +8,8 @@ export default function LanguageSwitcher() {
|
||||
const dropdownRef = useRef<HTMLDivElement>(null)
|
||||
|
||||
const languages = [
|
||||
{ code: 'zh-CN' as const, label: '中文' },
|
||||
{ code: 'en-US' as const, label: 'English' },
|
||||
{ code: 'zh-CN' as const, label: '中文' },
|
||||
]
|
||||
|
||||
const currentLanguage = languages.find((lang) => lang.code === language) || languages[0]
|
||||
|
||||
@@ -45,6 +45,7 @@ export default function DocsLayout({ children }: DocsLayoutProps) {
|
||||
{ title: isZh ? '知识注入' : 'Instructions', path: '/features/custom-instructions' },
|
||||
{ title: isZh ? '数据脱敏' : 'Data Masking', path: '/features/data-masking' },
|
||||
{ title: isZh ? 'Chrome 扩展' : 'Chrome Extension', path: '/features/chrome-extension' },
|
||||
{ title: 'MCP Server (Beta)', path: '/features/mcp-server' },
|
||||
{
|
||||
title: isZh ? '接入第三方 Agent' : 'Third-party Agent',
|
||||
path: '/features/third-party-agent',
|
||||
|
||||
70
packages/website/src/pages/docs/features/mcp-server/page.tsx
Normal file
70
packages/website/src/pages/docs/features/mcp-server/page.tsx
Normal file
@@ -0,0 +1,70 @@
|
||||
import BetaNotice from '@/components/BetaNotice'
|
||||
import CodeEditor from '@/components/CodeEditor'
|
||||
import { Heading } from '@/components/Heading'
|
||||
|
||||
export default function McpServerPage() {
|
||||
return (
|
||||
<div>
|
||||
<h1 className="text-4xl font-bold mb-6">MCP Server (Beta)</h1>
|
||||
<BetaNotice />
|
||||
<p className="text-xl text-gray-600 dark:text-gray-300 mb-8 leading-relaxed">
|
||||
Use the MCP server to let your local agent send natural-language browser tasks to Page Agent
|
||||
Ext.
|
||||
</p>
|
||||
|
||||
<section className="mb-10">
|
||||
<Heading id="quick-start" className="text-2xl font-bold mb-4">
|
||||
How to use
|
||||
</Heading>
|
||||
<div className="space-y-4">
|
||||
<div className="p-4 bg-blue-50 dark:bg-blue-950/20 rounded-lg border border-blue-200 dark:border-blue-800">
|
||||
<p className="text-sm text-blue-900 dark:text-blue-200 leading-7">
|
||||
1. Install Page Agent Ext in Chrome.
|
||||
<br />
|
||||
2. Add the MCP server to your local agent client.
|
||||
<br />
|
||||
3. Start the client and approve the Hub connection in the browser when prompted.
|
||||
<br />
|
||||
4. Ask your agent to do something in the browser. The client will call execute_task
|
||||
for you.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<CodeEditor
|
||||
code={`{
|
||||
"mcpServers": {
|
||||
"page-agent": {
|
||||
"command": "npx",
|
||||
"args": ["-y", "@page-agent/mcp"],
|
||||
"env": {
|
||||
"LLM_BASE_URL": "https://api.openai.com/v1",
|
||||
"LLM_API_KEY": "sk-xxx",
|
||||
"LLM_MODEL_NAME": "gpt-5.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
}`}
|
||||
language="json"
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section className="mb-10">
|
||||
<Heading id="the-hub" className="text-2xl font-bold mb-4">
|
||||
The Hub
|
||||
</Heading>
|
||||
|
||||
<p className="text-gray-700 dark:text-gray-300 leading-relaxed">
|
||||
The Hub is the control center for communication between Page Agent Ext and external
|
||||
callers.
|
||||
</p>
|
||||
<p className="text-gray-700 dark:text-gray-300 leading-relaxed">
|
||||
When the MCP server starts, it opens a local launcher page. The launcher asks the
|
||||
extension to open the Hub tab, and the Hub receives tasks from your local agent. MCP uses
|
||||
this path, but the Hub itself is the extension's general external communication entry
|
||||
point.
|
||||
</p>
|
||||
</section>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -33,8 +33,8 @@ const MODEL_GROUPS: Record<string, string[]> = {
|
||||
'claude-haiku-4.5',
|
||||
'claude-sonnet-3.5',
|
||||
],
|
||||
xAI: ['grok-4.1-fast', 'grok-4', 'grok-code-fast'],
|
||||
MiniMax: ['MiniMax-M2.7', 'MiniMax-M2.7-highspeed', 'MiniMax-M2.5', 'MiniMax-M2.5-highspeed'],
|
||||
xAI: ['grok-4.1-fast', 'grok-4', 'grok-code-fast'],
|
||||
MoonshotAI: ['kimi-k2.5'],
|
||||
'Z.AI': ['glm-5', 'glm-4.7'],
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import ChromeExtension from './features/chrome-extension/page'
|
||||
import Instructions from './features/custom-instructions/page'
|
||||
import CustomTools from './features/custom-tools/page'
|
||||
import DataMasking from './features/data-masking/page'
|
||||
import McpServerPage from './features/mcp-server/page'
|
||||
import Models from './features/models/page'
|
||||
import ThirdPartyAgent from './features/third-party-agent/page'
|
||||
import Limitations from './introduction/limitations/page'
|
||||
@@ -80,6 +81,11 @@ export default function DocsRouter() {
|
||||
<ChromeExtension />
|
||||
</DocsPage>
|
||||
</Route>
|
||||
<Route path="/features/mcp-server">
|
||||
<DocsPage>
|
||||
<McpServerPage />
|
||||
</DocsPage>
|
||||
</Route>
|
||||
<Route path="/features/third-party-agent">
|
||||
<DocsPage>
|
||||
<ThirdPartyAgent />
|
||||
|
||||
@@ -58,6 +58,22 @@ export default function OneMoreThingSection() {
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<div className="mb-10 rounded-2xl border border-blue-200/70 dark:border-blue-800/70 bg-linear-to-r from-blue-50 to-white dark:from-blue-950/30 dark:to-gray-900 px-5 py-4 max-w-3xl mx-auto text-left sm:text-center">
|
||||
<p className="text-sm text-gray-700 dark:text-gray-300 leading-7">
|
||||
{isZh
|
||||
? '从 Claude Desktop、Copilot 或其他本地 Agent 直接发起浏览器任务?'
|
||||
: 'Using Claude Desktop, Copilot, or another local agent? Connect it to the extension with the MCP server.'}
|
||||
</p>
|
||||
<p>
|
||||
<Link
|
||||
href="/docs/features/mcp-server"
|
||||
className="font-medium text-blue-700 dark:text-blue-300 underline underline-offset-4"
|
||||
>
|
||||
{isZh ? '查看 MCP 文档' : 'Read the MCP docs'}
|
||||
</Link>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="grid sm:grid-cols-3 gap-5 text-left max-w-3xl mx-auto">
|
||||
{[
|
||||
{
|
||||
@@ -67,16 +83,16 @@ export default function OneMoreThingSection() {
|
||||
: 'Run tasks across multiple pages and tabs without being limited to a single page context',
|
||||
},
|
||||
{
|
||||
title: isZh ? '页面内发起控制' : 'Control from Your Page',
|
||||
title: isZh ? '从页面发起控制' : 'Control from a WebPage',
|
||||
desc: isZh
|
||||
? '在页面 JS 中发起任务,驱动整个浏览器完成跨标签操作'
|
||||
: 'Trigger tasks from page JS to drive the entire browser across tabs',
|
||||
: 'Trigger tasks from in-page JS to drive the entire browser across tabs',
|
||||
},
|
||||
{
|
||||
title: isZh ? '外部发起任务' : 'External Triggers',
|
||||
title: isZh ? '外部发起任务' : 'External Caller',
|
||||
desc: isZh
|
||||
? '页面 JS、本地 Agent 或云端 Agent 均可通过扩展发起任务'
|
||||
: 'Page JS, local agents, or cloud agents can trigger tasks through the extension',
|
||||
: 'Local agents and cloud agents can control user browser through the extension',
|
||||
},
|
||||
].map((item) => (
|
||||
<MagicCard
|
||||
|
||||
@@ -27,6 +27,7 @@ const SPA_ROUTES = [
|
||||
'docs/features/custom-instructions',
|
||||
'docs/features/models',
|
||||
'docs/features/chrome-extension',
|
||||
'docs/features/mcp-server',
|
||||
'docs/features/third-party-agent',
|
||||
'docs/advanced/page-agent',
|
||||
'docs/advanced/page-agent-core',
|
||||
|
||||
Reference in New Issue
Block a user