Skip to content

Commit 4113eba

Browse files
committed
Merge remote-tracking branch 'origin/develop'
2 parents f6fcabe + a611014 commit 4113eba

40 files changed

+7573
-1153
lines changed

.env.example

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Kite MCP Server Environment Configuration
2+
# ---------------------------------------
3+
# This file contains all environment variables used by the Kite MCP Server.
4+
# Copy this file to ".env" and update with your actual values.
5+
6+
# Required Kite Connect API credentials
7+
# Register at https://developers.kite.trade/signup to obtain these
8+
KITE_API_KEY=your_api_key_here
9+
KITE_API_SECRET=your_api_secret_here
10+
11+
# Server configuration (optional - defaults shown)
12+
# ------------------------------------------------
13+
# APP_MODE: The communication mode for the server
14+
# - stdio: Standard input/output (best for Claude Desktop)
15+
# - http: HTTP mode (RESTful API) - default
16+
# - sse: Server-Sent Events over HTTP (best for web clients)
17+
# - hybrid: Combined mode with both SSE and MCP endpoints
18+
APP_MODE=http
19+
20+
# Server network settings (only used in http, sse, and hybrid modes)
21+
APP_PORT=8080 # Port to listen on (default: 8080)
22+
APP_HOST=localhost # Host to bind to (use 0.0.0.0 for all interfaces)
23+
24+
# Tool exclusion (optional)
25+
# -------------------------
26+
# EXCLUDED_TOOLS: Comma-separated list of tools to exclude from registration
27+
# - Useful for creating read-only instances or removing destructive operations
28+
# - Example: place_order,modify_order,cancel_order (excludes all order operations)
29+
# - Example: place_gtt_order,modify_gtt_order,delete_gtt_order (excludes GTT operations)
30+
# - Leave empty to enable all tools
31+
# EXCLUDED_TOOLS=place_order,modify_order,cancel_order
32+
33+
# Logging configuration (optional)
34+
# --------------------------------
35+
# LOG_LEVEL: Controls verbosity of logs
36+
# - debug: Verbose output for development
37+
# - info: Normal operational logs (default)
38+
# - warn: Only warning and error logs
39+
# - error: Only error logs
40+
LOG_LEVEL=info

.envrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Minimal direnv configuration to reduce verbose output
2+
export NIXPKGS_ALLOW_DIRTY=1
3+
dotenv_if_exists .env
4+
5+
# Silence direnv output as much as possible
6+
export DIRENV_WARN_TIMEOUT=0
7+
log_status() { :; }
8+
9+
use flake

.github/workflows/ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master, develop ]
6+
pull_request:
7+
branches: [ master, develop ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Install Nix
16+
uses: cachix/install-nix-action@v27
17+
with:
18+
nix_path: nixpkgs=channel:nixos-unstable
19+
20+
- name: Setup Nix environment
21+
run: nix develop --command echo "Nix environment ready"
22+
23+
- name: Run tests
24+
run: nix develop --command just test
25+
26+
- name: Run linting
27+
run: nix develop --command just lint

.github/workflows/release.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
if: startsWith(github.ref, 'refs/tags/v')
12+
permissions:
13+
contents: write
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Install Nix
18+
uses: cachix/install-nix-action@v27
19+
with:
20+
nix_path: nixpkgs=channel:nixos-unstable
21+
22+
- name: Setup Nix environment
23+
run: nix develop --command echo "Nix environment ready"
24+
25+
- name: Run tests
26+
run: nix develop --command just test
27+
28+
- name: Get version from tag
29+
id: version
30+
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
31+
32+
- name: Build for Linux
33+
run: nix develop --command bash -c "GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o kite-mcp-server-linux-amd64 -ldflags='-s -w -X main.MCP_SERVER_VERSION=${{ steps.version.outputs.VERSION }}' main.go"
34+
35+
- name: Build for macOS (Intel)
36+
run: nix develop --command bash -c "GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -o kite-mcp-server-darwin-amd64 -ldflags='-s -w -X main.MCP_SERVER_VERSION=${{ steps.version.outputs.VERSION }}' main.go"
37+
38+
- name: Build for macOS (Apple Silicon)
39+
run: nix develop --command bash -c "GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -o kite-mcp-server-darwin-arm64 -ldflags='-s -w -X main.MCP_SERVER_VERSION=${{ steps.version.outputs.VERSION }}' main.go"
40+
41+
- name: Build for Windows
42+
run: nix develop --command bash -c "GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -o kite-mcp-server-windows-amd64.exe -ldflags='-s -w -X main.MCP_SERVER_VERSION=${{ steps.version.outputs.VERSION }}' main.go"
43+
44+
- name: Make binaries executable
45+
run: |
46+
chmod +x kite-mcp-server-linux-amd64
47+
chmod +x kite-mcp-server-darwin-amd64
48+
chmod +x kite-mcp-server-darwin-arm64
49+
chmod +x kite-mcp-server-windows-amd64.exe
50+
51+
- name: Create GitHub Release
52+
uses: softprops/action-gh-release@v2
53+
with:
54+
files: |
55+
kite-mcp-server-linux-amd64
56+
kite-mcp-server-darwin-amd64
57+
kite-mcp-server-darwin-arm64
58+
kite-mcp-server-windows-amd64.exe
59+
generate_release_notes: true
60+
draft: false
61+
prerelease: false
62+
env:
63+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 81 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,83 @@
1+
# Environment files
12
.env
2-
oldpy
3+
.env.local
4+
.env.*.local
5+
6+
# Go build artifacts
7+
*.exe
8+
*.exe~
9+
*.dll
10+
*.so
11+
*.dylib
12+
*.bin
13+
kite-mcp-server
14+
main
15+
16+
# Go test files
17+
*.test
18+
*.prof
19+
coverage.out
20+
coverage.html
21+
22+
# Go module cache
23+
go.sum.backup
24+
25+
# Temporary files
26+
*.tmp
27+
*.temp
28+
*.log
29+
*.pid
30+
*.lock
31+
32+
# OS generated files
33+
.DS_Store
34+
.DS_Store?
35+
._*
36+
.Spotlight-V100
37+
.Trashes
38+
ehthumbs.db
39+
Thumbs.db
40+
41+
# IDE and editor files
42+
.vscode/
43+
.idea/
44+
*.swp
45+
*.swo
46+
*~
47+
.project
48+
.settings/
49+
*.sublime-project
50+
*.sublime-workspace
51+
52+
# Nix specific
53+
.direnv/
54+
result
55+
result-*
56+
57+
# Just cache
58+
.just/
59+
60+
# Build directories
61+
build/
62+
dist/
63+
target/
64+
65+
# Documentation build artifacts
66+
67+
# Local data files
368
instruments.json
4-
mcp.bin
69+
*.csv
70+
*.xlsx
71+
72+
# Legacy/old files
73+
oldpy/
74+
75+
# Runtime files
76+
*.pid
77+
*.sock
78+
79+
# Test binaries and artifacts
80+
test-binary
81+
kite-mcp-server-*
82+
83+
.memory

0 commit comments

Comments
 (0)