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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.