tyk README

项目的 README,来自 github.com/TykTechnologies/tyk。合并为一个 markdown 文件:README.md。

tyk-github-header License: MPL 2.0 FOSSA Status

GitHub Latest Release GitHub Release Date Docker Pulls GitHub Workflow Status (with event) Go Report Card

GitHub commit activity GitHub Repo Stars GitHub Repo Forks X twitter Follow


Documentation | MCP Gateway | AI Gateway | Forum | Blog | About

Tyk API Gateway

Tyk Gateway is the cloud-native, open source, enterprise-ready API and AI Gateway supporting REST, GraphQL, TCP, gRPC and MCP (Model Context Protocol).

Built from the ground up, as the fastest API Gateway on the planet since 2014.

Tyk Gateway is provided ‘Batteries-included’, with no feature lockout. Enabling your organization to rate limit, auth, gather analytics, apply microservice patterns and more with ease.

There are three different ways you can try Tyk:


Everything you need to manage APIs using Tyk Open Source. Follow the simple Get Started guide below 👇

The Enterprise API Management platform: Management Control Plane with GUI & Developer Portal.
Tyk Self Managed

The Enterprise API Management SaaS platform: hosted Management Control Plane with GUI & Developer Portal.
Tyk Cloud

Getting Started

Tyk Cloud is the easiest way to set up Tyk. Tyk hosts and manages the full stack for you, so you do not install anything. You can sign up for a free trial of Tyk Cloud and get started in minutes. If not, you can follow the instructions below to get started with Tyk on your own infrastructure.

Run the open source Tyk Gateway with Docker in under 2 minutes. You need Docker and Docker Compose.

Follow the Tyk Open Source Gateway quick start. It shows you how to:

  1. Create a Gateway configuration file (tyk.conf).
  2. On Linux, create an apps folder where the Gateway saves your APIs.
  3. Create a Docker Compose file that runs Tyk Gateway and Redis.
  4. Start the Gateway with docker compose up -d.

Confirm that the Gateway runs. Send a request to the hello endpoint:

curl localhost:8080/hello

Output:

{"status":"pass","version":"5.x.x","description":"Tyk GW"}

Next, create your first API with the Tyk Gateway API.

Try full API Management Lifecycle

To evaluate the enterprise API management platform on your infrastructure, use Tyk Install. It runs Tyk Gateway, Tyk Dashboard, the Developer Portal, Tyk Pump, Redis and PostgreSQL with Docker Compose, and preloads sample APIs and policies. You need a licence. To get one, request a Tyk Self-Managed trial.

git clone https://github.com/TykTechnologies/tyk-install
cd tyk-install/docker/self-managed
cp .env.example .env   # add your licence keys to .env
cd ../getting-started
bash start.sh

For the full steps, see the Tyk Self-Managed quick start.


Other Installations are available:

  1. Docker
  2. Kubernetes with Helm (tyk-oss chart from Tyk Charts)
  3. Ansible
  4. Red Hat and CentOS
  5. Ubuntu
  6. Compile Tyk from Source

Getting started with AI Gateway for LLM and MCP

Tyk Gateway governs MCP traffic from AI agents, applying authentication, rate limiting and per-tool access control to every JSON-RPC call. Tyk AI Studio handles LLM management, with model routing, budgets and guardrails across providers. Start at the AI management overview.

Open Source API Gateway Features

Use any protocol: REST (with native OpenAPI support), SOAP, GraphQL, gRPC, TCP, and MCP.

MCP Gateway: Put the gateway in front of remote Model Context Protocol servers so AI agent traffic is authenticated, rate limited and auditable. Tyk parses JSON-RPC 2.0 and applies policy per tool, resource and prompt rather than treating MCP as opaque HTTP.

API to MCP: Generate an MCP proxy directly from a REST API in Tyk Gateway, without building or hosting a separate MCP server.

Industry Standard Authentication: JWT, bearer Tokens, Basic Auth, Client Certificates and more.

Open API Standards: Import your Swagger and OpenAPI Documents (OAS 2.X and OAS 3.0.1) to scaffold APIs in Tyk.

Ultra performant: Low latency, and thousands of rps with just a single CPU, horizontally and vertically scalable.

Content mediation: Transform all the things, from request or response headers to converting between SOAP and GraphQL.

Extensible Plugin Architecture: Customize Tyk’s middleware chain by writing plugins in your language of choice - from Python to Javascript to Go, or any language which supports gRPC.

Rate Limiting & Quotas: Protect your upstreams from becoming overloaded and/or apply limits for each consumer.

API Versioning - API Versions can be easily set and sunset (deprecated) at a specific time and date.

Granular Access Control - Grant access to one or more APIs on a per version and operation basis.

Blocklist/Allowlist/Ignore endpoint access - Enforce strict security models on a version-by-version basis to your access points.

Analytics logging - Record detailed usage data on who is using your APIs (raw data only)

CORS - Enable CORS for certain APIs so users can make browser-based requests

Webhooks - Trigger webhooks against events such as Quota Violations and Authentication failures

IP AllowListing - Block access to non-trusted IP addresses for more secure interactions

Hitless reloads - Tyk configurations can be altered dynamically and the service restarted without affecting any active request

Kubernetes native declarative API: using Tyk Operator (requires a licence) OpenSourceAPIGateway-Diagram

Tyk Technologies uses the same API Gateway for all it’s applications. Protecting, securing, and processing APIs for thousands of organizations and businesses around the world. Ideal for Open Banking, building software in the clouds as well as exposing APIs to teams, partners & consumers.

Tyk OSS Integrations

Tyk Technologies maintains other Open Source Software which can be used in conjunction with Tyk API Gateway:

Tyk AI Studio - Open source (AGPL-3.0) AI management platform for LLM traffic: model routing, budgets and cost controls, RAG data sources, tools and agents, with governance across providers including OpenAI, Anthropic, AWS Bedrock, Google Vertex AI, Hugging Face and Ollama. Use it alongside Tyk Gateway when you need LLM and AI management rather than MCP proxying. Docs

Tyk Pump - Pluggable analytics purger to move Analytics generated by your Tyk nodes to any back-end.

Tyk Identity Broker - Tyk Authentication Proxy for third-party login

Tyk Mserv - Asset Server and gRPC host

Documentation

All the documentation for Tyk Gateway and other OSS-related topics can be found at https://tyk.io/docs/tyk-open-source

Community

Licensing

Tyk is dual-licensed:

  1. Open Source License: The code in the root directory and all subdirectories except the 'ee' folder is released under the MPL v2.0. Please see LICENSE for the full version of the open source license.

  2. Commercial License: The code in the 'ee' folder is subject to a commercial license. For more information about obtaining a commercial license, please contact our sales team at [email protected].

Compiling Tyk Gateway

Compile from Source

git clone https://github.com/TykTechnologies/tyk
go build

Use the Go version in go.mod to build master, the current development version. Tyk is officially supported on Linux/amd64, Linux/i386 and Linux/arm64.

To run tests locally use the following command:

go test ./...

Note that tests require Redis to be running on the same machine (default port).

To write your own test please use this guide https://github.com/TykTechnologies/tyk/blob/master/TESTING.md

Contributing

For more information about contributing PRs and issues, see CONTRIBUTING.md.

—

tyk (TykTechnologies/tyk)

正在搜索数据库…

10.9K ·GitHub
这是什么?Tyk 是一款开源、云原生的 API 网关,可以在同一个地方管理 REST、GraphQL、TCP、gRPC 和 MCP(Model Context Protocol,模型上下文协议)流量,并为你的 API 添加身份验证、限流、配额和分析功能。
这是我需要导入的库,还是需要部署的独立服务?它是一个独立的网关服务,你需要把它部署在 API 前面(可通过 Docker、Kubernetes、Helm、Ansible 或原生安装包部署),而不是要导入到应用代码中的库。
我该如何让 Tyk 运行起来?克隆 docker-compose 仓库,进入新目录,然后运行 'docker-compose up -d',即可在 5 分钟以内同时部署 Tyk Gateway 和 Redis。同时也支持 Kubernetes-Native、Helm、Ansible、Red Hat、Ubuntu、CentOS 以及从源代码编译。
运行 Tyk 必须要有 Redis 吗?是的,Tyk 依赖 Redis 来存储状态和分析数据,Docker Compose 快速入门会在 Gateway 旁边一同部署 Redis。从源代码编译还需要 Go 1.22。
Tyk 的所有功能都是免费且开源的吗?大部分是:'ee' 文件夹之外的代码采用 MPL v2.0 许可证的开源协议,但 'ee'(企业版)文件夹适用单独的商业许可证,因此部分功能需要付费许可证。
编译后的 Gateway 二进制文件我能在哪些操作系统上运行?从源代码编译时,Tyk 官方支持 Linux/amd64、Linux/i386 和 Linux/arm64;使用 Docker 和 Kubernetes 发行版则无需关心底层操作系统。
Tyk Technologies 还维护哪些其他开源工具?除了 Gateway,Tyk 还维护 Tyk Pump(分析数据清理工具)、Tyk Operator(通过 CRD 进行 Kubernetes API 管理)、Tyk Identity Broker(用于第三方登录的认证代理)、Tyk Sync(用于将配置与版本控制同步的命令行工具)和 Tyk Mserv(资源与 gRPC 托管服务)。
我可以用哪些语言编写 Gateway 插件?Tyk 的可扩展插件架构允许你用 Python、JavaScript、Go 或任何支持 gRPC 的语言编写自定义中间件。
Tyk 能原生支持 Kubernetes 吗?可以,开源的 Tyk Operator 允许你使用 Kubernetes 自定义资源来管理 Ingress、API、安全策略和身份验证,因此 Tyk 可以在 K8s 上完全以声明式方式运行。
Tyk 与其他网关相比速度如何?Tyk 自称是 2014 年以来最快的 API 网关,在单个 CPU 上即可实现低延迟和每秒数千次请求,并且支持水平和垂直扩展。
有哪些类似的项目?kong, apisix, bifrost, agentgateway, casdoor, busbar, new-api, evenfire
大小
262.1 MB
星标
10.9K
时长
12年
提交 · 90 天