Token导航 LogoToken导航

MCP Server · 安全风控

MCPF-typescript

MCPF TypeScript SDK 是一个提供完整类型安全接口的软件开发工具包,支持 MCPF 信任框架的所有组件,包括 DID/VC、ANS、MCP 注册表和 A2A 委托。

未说明官方级别未说明来源级核验工具 0
TypeScript类型安全安全

快速开始

公开资料没有提供安装命令,按仓库或官方文档接入。
作者 / 组织
MCPTrustFramework
提供方
MCPTrustFramework

工具数量

0

来源目录标注

资源数量

0

来源目录标注

提示词数量

0

来源目录标注

GitHub Star

2

仓库热度

收录来源

1 个

MCP World

选型结论

MCPF-typescript 属于安全风控类 MCP Server,公开资料标注 0 个工具,通过传输方式未标注接入,客户端适配情况以官方文档为准,没有现成的安装命令;接入前先确认权限范围。

分类

安全风控

传输方式

未说明

认证方式

无需认证

部署方式

公开资料未说明

安装与配置

公开目录没有给出安装命令,需要按仓库 README安装;下面按同类条目的通用流程说明。

公开命令不是通用的启动方式,拼不出可靠配置示例;请在客户端 MCP 配置里按官方文档填写 command 和 args。

上手步骤

  1. 1

    先确认运行方式

    公开资料没有标注传输方式,先看仓库 README,确认是本地进程还是远程地址。

  2. 2

    获取服务

    公开目录没有给出安装命令,按仓库 README里的步骤安装或获取服务。

  3. 3

    写入客户端配置

    在客户端的 MCP 配置里填启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4

    验证是否可用

    连接成功后客户端会列出 0 个工具,随便调一个只读工具确认能返回结果。

接入前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

公开资料仍需确认:安装命令

详细介绍

MCPF TypeScript SDK

MCPF的完整TypeScript SDK -所有MCPF信任框架组件的类型安全、现代接口:DID/VC、ANS、MCP注册表和A2A委托。

🌟 什么是MCPF字体?

MCPF TypeScript SDK为整个MCPF信任框架提供了一个完全类型安全的接口:

import { MCPF } from 'mcpf-typescript';

// Initialize SDK
const mcpf = new MCPF({
  ansUrl: 'https://ans.veritrust.vc',
  registryUrl: 'https://ans.veritrust.vc/mcp',
  a2aUrl: 'https://a2a.example.com'
});

// Resolve agent name → verify credentials → check delegation
const agent = await mcpf.resolveAndVerify('fraud-detector.risk.bank.example.agent');
if (await mcpf.canDelegate(agent.did, targetDid, 'analyze')) {
  const result = await executeTask(agent, targetDid, taskData);
}

特性

  • 🔐 DID/VC管理 -创建DID、颁发/验证凭据、管理吊销
  • 📛 ANS客户端 -解析代理名称、注册代理、搜索目录
  • 📋 MCP注册表 -发现受信任的MCP服务器,验证凭据
  • 🔄 A2A代表团 -检查委派权限,管理策略
  • ✅ 完全验证 -端到端凭据和策略验证
  • ⚡ 全类型安全 -全面的TypeScript类型
  • 🎯 现代ES模块 -ESM支持树木摇动
  • 🧪 测试良好 -覆盖率超过90%的全面测试套件
  • 📦 零依赖 -仅本机获取API

🚀 快速开始

安装

npm install mcpf-typescript
# or
yarn add mcpf-typescript
# or
pnpm add mcpf-typescript

基本用法

import { MCPF } from 'mcpf-typescript';

const mcpf = new MCPF();

// Resolve an agent name
const agent = await mcpf.ans.resolve('fraud-detector.risk.bank.example.agent');
console.log(`Agent DID: ${agent.did}`);
console.log(`Capabilities: ${agent.capabilities.join(', ')}`);

// Verify agent credential
const isValid = await mcpf.did.verifyCredential(agent.credentialUrl);
console.log(`Credential valid: ${isValid}`);

// Check delegation permission
const canDelegate = await mcpf.a2a.checkDelegation({
  fromDid: 'did:web:agent1.example',
  toDid: 'did:web:agent2.example',
  action: 'analyze'
});
console.log(`Delegation allowed: ${canDelegate.allowed}`);

📖 api参考

MCPF客户端(统一接口)

import { MCPF, MCPFConfig } from 'mcpf-typescript';

const config: MCPFConfig = {
  ansUrl: 'https://ans.veritrust.vc',
  registryUrl: 'https://ans.veritrust.vc/mcp',
  a2aUrl: 'https://a2a.example.com',
  didResolverUrl: 'https://resolver.example.com'
};

const mcpf = new MCPF(config);

// Unified operations
const agent = await mcpf.resolveAndVerify(agentName);
const canDelegate = await mcpf.canDelegate(fromDid, toDid, action);
const server = await mcpf.findMcpServer({ capability: 'weather' });

DID/VC模块

import { DIDManager, VCIssuer, VCVerifier } from 'mcpf-typescript';

// DID operations
const didManager = new DIDManager();
const did = didManager.createDid({ method: 'web', domain: 'example.com' });
const didDoc = await didManager.resolveDid(did);

// Issue credentials
const issuer = new VCIssuer({
  issuerDid: 'did:web:veritrust.vc',
  privateKey: privateKey
});

const credential = issuer.issueCredential({
  subjectDid: 'did:web:agent.example',
  credentialType: 'AgentOwnershipCredential',
  claims: { permissions: ['query', 'analyze'] }
});

// Verify credentials
const verifier = new VCVerifier();
const result = await verifier.verifyCredential(credential);
console.log(`Valid: ${result.valid}, Revoked: ${result.isRevoked}`);

ANS模块

import { ANSClient, AgentCard } from 'mcpf-typescript';

const ans = new ANSClient('https://ans.veritrust.vc');

// Resolve agent name
const agentCard: AgentCard = await ans.resolve({
  name: 'fraud-detector.risk.bank.example.agent',
  version: '1.0.0' // Optional
});

// Register agent
await ans.register({
  name: 'my-agent.company.example.agent',
  version: '1.0.0',
  did: 'did:web:company.example:agent:my-agent',
  provider: 'My Company',
  capabilities: ['query', 'analyze'],
  endpoints: {
    agent: 'https://company.example/agent',
    presentations: 'https://company.example/agent/vp'
  }
});

// Search agents
const results = await ans.search({ capability: 'fraud-detection' });

MCP注册表模块

import { MCPRegistry, MCPServer } from 'mcpf-typescript';

const registry = new MCPRegistry('https://ans.veritrust.vc/mcp');

// List MCP servers
const servers = await registry.listServers({ page: 1, limit: 50 });

// Get server by DID
const server: MCPServer = await registry.getServer(
  'did:web:weather.example.com:mcp:api'
);

// Search by capability
const weatherServers = await registry.search({
  capability: 'getCurrentWeather'
});

// Register MCP server
await registry.registerServer({
  did: 'did:web:myapi.example.com:mcp',
  endpoint: 'https://myapi.example.com/mcp',
  manifest: 'https://myapi.example.com/mcp/manifest.json',
  credentials: [...],
  metadata: {
    capabilities: ['query', 'analyze'],
    organization: 'My Company',
    country: 'US'
  }
});

A2A模块

import { A2ARegistry, DelegationResult, Policy } from 'mcpf-typescript';

const a2a = new A2ARegistry('https://a2a.example.com');

// Check delegation permission
const result: DelegationResult = await a2a.checkDelegation({
  fromDid: 'did:web:fraud-detector.bank.example',
  toDid: 'did:web:risk-analyzer.bank.example',
  action: 'analyze'
});

if (result.allowed) {
  console.log(`Delegation allowed: ${result.policy}`);
} else {
  console.log(`Delegation denied: ${result.reason}`);
}

// Register delegation policy
const policy: Policy = await a2a.registerPolicy({
  fromAgent: 'did:web:agent1.example',
  toAgent: 'did:web:agent2.example',
  allowedActions: ['query', 'analyze'],
  constraints: {
    maxDuration: 3600,
    scope: ['transaction-data']
  },
  issuedBy: 'did:web:example.com',
  validFrom: '2025-01-01T00:00:00Z',
  validUntil: '2026-01-01T00:00:00Z'
});

// Get audit log
const audit = await a2a.getAuditLog({
  fromDid: 'did:web:agent1.example',
  startDate: '2025-01-01'
});

📝 完整示例

示例1:端到端代理验证

import { MCPF } from 'mcpf-typescript';

async function verifyAgentChain() {
  const mcpf = new MCPF({
    ansUrl: 'https://ans.veritrust.vc',
    registryUrl: 'https://ans.veritrust.vc/mcp'
  });
  
  // 1. Resolve agent name to DID
  const agent = await mcpf.ans.resolve({
    name: 'fraud-detector.risk.bank.example.agent'
  });
  console.log(`✓ Resolved: ${agent.name} → ${agent.did}`);
  
  // 2. Get DID document
  const didDoc = await mcpf.did.resolveDid(agent.did);
  console.log(`✓ DID Document: ${didDoc.verificationMethod.length} keys`);
  
  // 3. Verify agent credential
  const verification = await mcpf.did.verifyCredentialUrl(agent.credentialUrl);
  console.log(`✓ Credential valid: ${verification.valid}`);
  console.log(`✓ Not revoked: ${!verification.isRevoked}`);
  
  // 4. Check all verifications passed
  if (verification.valid && !verification.isRevoked) {
    console.log('✅ Agent fully verified!');
    return agent;
  } else {
    console.log('❌ Agent verification failed');
    return null;
  }
}

verifyAgentChain();

示例2:委派工作流

import { MCPF } from 'mcpf-typescript';

async function delegationWorkflow() {
  const mcpf = new MCPF({
    ansUrl: 'https://ans.veritrust.vc',
    a2aUrl: 'https://a2a.example.com'
  });
  
  // Resolve both agents
  const fromAgent = await mcpf.ans.resolve({
    name: 'fraud-detector.risk.bank.example.agent'
  });
  const toAgent = await mcpf.ans.resolve({
    name: 'risk-analyzer.analytics.bank.example.agent'
  });
  
  // Verify both agents
  const fromValid = await mcpf.did.verifyAgent(fromAgent.did);
  const toValid = await mcpf.did.verifyAgent(toAgent.did);
  
  if (!fromValid || !toValid) {
    console.log('❌ Agent verification failed');
    return;
  }
  
  // Check delegation permission
  const delegation = await mcpf.a2a.checkDelegation({
    fromDid: fromAgent.did,
    toDid: toAgent.did,
    action: 'analyze'
  });
  
  if (delegation.allowed) {
    console.log('✅ Delegation allowed');
    console.log(`   Policy: ${delegation.policy?.id}`);
    console.log(`   Constraints: ${JSON.stringify(delegation.policy?.constraints)}`);
    
    // Execute delegation
    const result = await executeAnalysis(fromAgent, toAgent, data);
    console.log(`✅ Task completed: ${result}`);
  } else {
    console.log(`❌ Delegation denied: ${delegation.reason}`);
  }
}

delegationWorkflow();

示例3:MCP服务器发现

import { MCPF } from 'mcpf-typescript';

async function findWeatherServer() {
  const mcpf = new MCPF({
    registryUrl: 'https://ans.veritrust.vc/mcp'
  });
  
  // Search for weather servers
  const servers = await mcpf.registry.search({
    capability: 'getCurrentWeather',
    country: 'US'
  });
  
  console.log(`Found ${servers.items.length} weather servers:`);
  
  for (const server of servers.items) {
    console.log(`\n  Server: ${server.did}`);
    console.log(`  Endpoint: ${server.endpoint}`);
    console.log(`  Organization: ${server.metadata.organization}`);
    console.log(`  Capabilities: ${server.metadata.capabilities.join(', ')}`);
    
    // Verify server credential
    if (server.credentials.length > 0) {
      const cred = server.credentials[0];
      const verification = await mcpf.did.verifyCredentialUrl(cred.credentialUrl);
      console.log(`  Verified: ${verification.valid ? '✓' : '✗'}`);
    }
  }
}

findWeatherServer();

示例4:完全集成

import { MCPF } from 'mcpf-typescript';

async function completeWorkflow() {
  /**
   * Complete MCPF workflow: resolve → verify → check delegation → execute
   */
  
  const mcpf = new MCPF({
    ansUrl: 'https://ans.veritrust.vc',
    registryUrl: 'https://ans.veritrust.vc/mcp',
    a2aUrl: 'https://a2a.example.com'
  });
  
  // 1. Resolve agent names
  console.log('1️⃣  Resolving agent names...');
  const fromAgent = await mcpf.ans.resolve({
    name: 'fraud-detector.risk.bank.example.agent'
  });
  const toAgent = await mcpf.ans.resolve({
    name: 'risk-analyzer.analytics.bank.example.agent'
  });
  
  // 2. Verify credentials
  console.log('2️⃣  Verifying credentials...');
  const fromValid = await mcpf.did.verifyAgent(fromAgent.did);
  const toValid = await mcpf.did.verifyAgent(toAgent.did);
  
  if (!fromValid || !toValid) {
    console.log('❌ Credential verification failed');
    return;
  }
  
  // 3. Check if MCP server is registered
  console.log('3️⃣  Checking MCP registry...');
  try {
    const mcpServer = await mcpf.registry.getServer(toAgent.did);
    console.log(`   ✓ MCP server registered: ${mcpServer.endpoint}`);
  } catch {
    console.log('   ℹ️  Not an MCP server');
  }
  
  // 4. Check delegation permission
  console.log('4️⃣  Checking delegation permission...');
  const delegation = await mcpf.a2a.checkDelegation({
    fromDid: fromAgent.did,
    toDid: toAgent.did,
    action: 'analyze'
  });
  
  if (!delegation.allowed) {
    console.log(`❌ Delegation denied: ${delegation.reason}`);
    return;
  }
  
  console.log(`   ✓ Delegation allowed (policy: ${delegation.policy?.id})`);
  
  // 5. Execute task
  console.log('5️⃣  Executing task...');
  const result = {
    fromAgent: fromAgent.name,
    toAgent: toAgent.name,
    action: 'analyze',
    status: 'success'
  };
  
  console.log('✅ Workflow complete!');
  return result;
}

completeWorkflow();

🧪 测试

# Run tests
npm test

# With coverage
npm run test:coverage

# Type checking
npm run type-check

# Linting
npm run lint

# Build
npm run build

📚 文档

完整文档可在https://mcpf.dev/docs/typescript

🔧 配置

环境变量

# ANS endpoint
MCPF_ANS_URL=https://ans.veritrust.vc

# MCP Registry endpoint
MCPF_REGISTRY_URL=https://ans.veritrust.vc/mcp

# A2A Registry endpoint
MCPF_A2A_URL=https://a2a.example.com

# DID Resolver
MCPF_DID_RESOLVER_URL=https://resolver.example.com

# Timeout (ms)
MCPF_TIMEOUT=30000

程序化配置

import { MCPF, MCPFConfig } from 'mcpf-typescript';

const config: MCPFConfig = {
  ansUrl: process.env.MCPF_ANS_URL || 'https://ans.veritrust.vc',
  registryUrl: process.env.MCPF_REGISTRY_URL || 'https://ans.veritrust.vc/mcp',
  a2aUrl: process.env.MCPF_A2A_URL,
  didResolverUrl: process.env.MCPF_DID_RESOLVER_URL,
  timeout: 30000,
  verifySsl: true
};

const mcpf = new MCPF(config);

🤝 贡献

看 贡献.md 作为指导方针。

📝 许可证

MIT许可证-请参阅 许可证

📞 联系

  • 网站: https://mcpf.dev
  • github: https://github.com/MCPTrustFramework/MCPF-typescript
  • 问题: https://github.com/MCPTrustFramework/MCPF-typescript/issues
  • npm: https://www.npmjs.com/package/mcpf-typescript

🔗 相关项目

______________________________________________________________________

版本: 1.0.0-alpha\ 最后更新时间: 2025年12月31日\ 状态: 生产准备就绪

工具与能力

工具数量

0

资源数量

0

提示词数量

0

能力标签

DID/VC管理TypeScript本地部署代理名称解析MCP注册表A2A委托类型安全

数量来自来源目录的标注,具体工具清单以官方文档为准。

典型使用场景

资产与漏洞排查

批量查询资产和漏洞信息,输出待修清单。

日志审计

从日志里筛出异常访问和高风险操作。

合规检查

按规则核对配置项,记录不符合项。

选择建议

值得选的地方

  • 只提供 0 个工具,职责集中,接入后不容易误操作。
  • 公开说明写得比较完整,接入前能看清能力边界。

先想清楚的地方

  • 公开资料没有可直接复制的安装命令,第一次接入要自己找入口。
  • 第三方目录整理,版本更新和行为细节以官方仓库为准。

更适合

  • 需要在安全风控场景里让模型直接调用外部能力的人。
  • 愿意照着官方文档一步步配环境的人。

不太适合

  • 希望一条命令就装好、不想看文档的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

5 个同类
MCP Server工具数传输方式安装命令收录来源最后核验
MCPF-typescript

MCP World · 本页

0未说明未标注1 个2026-05-17
Modelcontextprotocol C22988b0

MCP World

0stdio有1 个2026-05-17
Hexstrike AI

MCP World

0stdio有1 个2026-05-17
Cyber Strike AI

MCP World

75未说明未标注1 个2026-05-17
MCP Scan

MCP World

0stdio有1 个2026-05-17

按同分类和工具数量挑出最接近的几条,字段以各自详情页为准。

常见问题

5 条

MCPF-typescript 怎么安装?

公开目录没有给出可以直接复制的安装命令,需要按仓库 README里的步骤安装;装好后写进客户端的 MCP 配置再重启。

MCPF-typescript 怎么在 Claude Desktop、Cursor 里配置?

它是传输方式未标注,客户端配置里要写启动命令和参数,运行环境是 未标注;保存后完全退出客户端再打开,配置才会生效。

MCPF-typescript 收费吗?

本站只整理公开资料,不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

MCPF-typescript 需要 API Key 吗?

公开资料标注为无需认证,装好就能连;如果实际调用时报鉴权错误,按官方文档补上凭据。

MCPF-typescript 支持哪些客户端?

公开资料没有标注具体客户端;能配置本地 MCP 命令的客户端都能接,配置方式参照官方文档。

来源信息

继续浏览同类 MCP