TBC Guidelines Automation System
Provides real-time TBC Bank development standards compliance checking and code review tools. Integrates with GitHub Copilot and development workflows to automatically enforce coding guidelines and reduce violations.
README
🏦 TBC Guidelines Automation System
Real-time TBC compliance checking + GitHub Copilot integration for your development team
Automatically enforces TBC Bank development standards with:
- ✅ Real-time violation detection (red squiggly lines)
- ✅ GitHub Copilot TBC awareness (generates compliant code)
- ✅ 24 comprehensive TBC guidelines loaded from Confluence
- ✅ Clean, direct suggestions (no verbose comments)
- ✅ Team-wide consistency across all projects
🎯 Team Benefits
- 50% fewer TBC violations in code reviews
- Instant feedback while coding (no waiting for CI/CD)
- Automated compliance - developers can't miss standards
- Faster onboarding - new team members learn TBC patterns automatically
Installation & Setup
Global Installation (Recommended)
# From the server project directory
npm run build
npm link
# Verify installation
which tbc-guidelines # Should show the global path
tbc-guidelines # Should start the server (Ctrl+C to exit)
Alternative: Local Installation
npm install tbc-guidelines-mcp-server
Usage
1. Global Command Line Usage
After global installation, you can run the MCP server from any directory:
tbc-guidelines
This starts the MCP server with stdio transport, ready to receive JSON-RPC requests.
2. Using in Other Node.js Projects
Method A: Subprocess Integration (Recommended)
Create a client in your project to communicate with the MCP server:
// guidelines-client.js
const { spawn } = require('child_process');
class GuidelinesClient {
constructor() {
this.requestId = 1;
this.server = null;
}
async start() {
// Start the global MCP server
this.server = spawn('tbc-guidelines', [], {
stdio: ['pipe', 'pipe', 'pipe']
});
// Initialize the server
await this.sendRequest('initialize', {
protocolVersion: '2024-11-05',
capabilities: {},
clientInfo: { name: 'guidelines-client', version: '1.0.0' }
});
}
async sendRequest(method, params = {}) {
return new Promise((resolve, reject) => {
const request = {
jsonrpc: '2.0',
id: this.requestId++,
method,
params
};
let response = '';
const onData = (data) => {
response += data.toString();
try {
const parsed = JSON.parse(response);
this.server.stdout.off('data', onData);
resolve(parsed.result);
} catch (e) {
// Continue reading
}
};
this.server.stdout.on('data', onData);
this.server.stdin.write(JSON.stringify(request) + '\n');
setTimeout(() => {
this.server.stdout.off('data', onData);
reject(new Error('Request timeout'));
}, 5000);
});
}
async getGuidelines() {
return await this.sendRequest('resources/list');
}
async getGuideline(uri) {
return await this.sendRequest('resources/read', { uri });
}
async reviewCode(code, language = 'typescript') {
return await this.sendRequest('tools/call', {
name: 'review_code',
arguments: { code, language }
});
}
close() {
if (this.server) {
this.server.kill();
}
}
}
// Usage example
async function main() {
const client = new GuidelinesClient();
await client.start();
try {
// List all guidelines
const guidelines = await client.getGuidelines();
console.log('Available guidelines:', guidelines.resources.map(r => r.name));
// Get a specific guideline
const guideline = await client.getGuideline('guideline://typescript-best-practices');
console.log('TypeScript Guidelines:', guideline.contents[0].text.substring(0, 200) + '...');
// Review some code
const codeReview = await client.reviewCode(`
function test() {
var x = 1;
return x;
}
`);
console.log('Code Review:', codeReview.content[0].text);
} finally {
client.close();
}
}
main().catch(console.error);
Method B: Direct Package Import
If you install the package locally:
// direct-usage.js
const { McpServer } = require('@modelcontextprotocol/sdk/server/mcp.js');
const { StdioServerTransport } = require('@modelcontextprotocol/sdk/server/stdio.js');
// Import your server setup
const { setupServer } = require('tbc-guidelines-mcp-server/build/server');
async function createCustomServer() {
const server = new McpServer({
name: 'custom-guidelines-server',
version: '1.0.0'
});
await setupServer(server);
// Add your custom resources or tools here
server.setRequestHandler(ResourceListRequestSchema, async () => {
// Custom logic
});
const transport = new StdioServerTransport();
await server.connect(transport);
}
3. Integration with AI/LLM Tools
Claude Desktop Integration
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"tbc-guidelines": {
"command": "tbc-guidelines"
}
}
}
VS Code Extension Integration
// In your VS Code extension
const { spawn } = require('child_process');
function activateGuidelinesServer() {
const server = spawn('tbc-guidelines', [], {
stdio: ['pipe', 'pipe', 'pipe']
});
// Handle communication
server.stdout.on('data', (data) => {
// Process MCP responses
});
return server;
}
4. Docker Usage
Create a Dockerfile in your project:
FROM node:18-alpine
# Install the guidelines server globally
RUN npm install -g tbc-guidelines-mcp-server
# Your app code
COPY . /app
WORKDIR /app
RUN npm install
# Start both your app and the guidelines server
CMD ["node", "your-app.js"]
5. CI/CD Integration
Use in GitHub Actions or other CI systems:
# .github/workflows/test.yml
name: Test with Guidelines
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install Guidelines Server
run: npm install -g tbc-guidelines-mcp-server
- name: Run Code Review
run: |
# Your test script that uses tbc-guidelines
node scripts/review-changes.js
Available Resources
guideline://typescript-best-practices- TypeScript coding standardsguideline://react-patterns- React component patternsguideline://api-design- REST API design guidelinesguideline://security-practices- Security best practicesguideline://testing-standards- Testing guidelines
Available Tools
review_code- Analyzes code against TBC guidelinesping- Health check tool
API Reference
Resources
List Resources
{
"method": "resources/list",
"params": {}
}
Read Resource
{
"method": "resources/read",
"params": {
"uri": "guideline://typescript-best-practices"
}
}
Tools
Review Code
{
"method": "tools/call",
"params": {
"name": "review_code",
"arguments": {
"code": "your code here",
"language": "typescript"
}
}
}
Troubleshooting
Command Not Found
If tbc-guidelines command is not found after installation:
# Check if it's in your PATH
which tbc-guidelines
# Or run directly
npx tbc-guidelines-mcp-server
Permission Issues
# Make sure the binary is executable
chmod +x $(which tbc-guidelines)
JSON-RPC Communication Issues
- Ensure you're sending proper JSON-RPC 2.0 format
- Always include
jsonrpc: "2.0",id, andmethodfields - Handle responses asynchronously
Examples Repository
See the examples/ directory for more detailed usage examples:
simple-client.js- Basic client implementationadvanced-integration.js- Advanced usage patternsclaude-integration.md- Claude Desktop setup guide
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。